Install using pip (>= 19.0)
pip install git+https://github.com/cms-l1-globaltrigger/tm-vhdlproducer.git@2.23.0Basic development instructions.
git clone https://github.com/cms-l1-globaltrigger/tm-vhdlproducer.git
cd tm-vhdlproducer
git checkout masterCreate virtual environment.
python3 -m venv env
. env/bin/activateInstall package for local development.
pip install --upgrade pip
pip install --editable .Generate VHDL output from XML trigger menu.
tm-vhdlproducer --modules <n> -d|--dist <n> [--ratio <f>]
[--sorting asc|desc] [--constraint <type:modules>]
[--dryrun] <menu>
Example for distributing on two modules:
tm-vhdlproducer L1Menu_sample.xml --modules 2 --dist 1This will create a directory L1Menu_sample-d1/ in the current directory.
To specify the distribution number use the --dist flag. For example
tm-vhdlproducer L1Menu_sample.xml --modules 2 --dist 2 # set distribution number to 2will write the output to /tmp/L1Menu_sample-d2/.
Example for reversing algorithm distribution descending order (default ascending):
tm-vhdlproducer L1Menu_sample.xml --modules 2 --dist 1 --sorting descThis will distribute algorithms from high to low payload weight.
To specify a different output location use the --output flag. For example
tm-vhdlproducer L1Menu_sample.xml --modules 2 --dist 1 --output /tmpwill write the output to /tmp/L1Menu_sample-d1/.
Adjust the shadow ratio to optimize the distribution of algorithms. A good starting point is a ratio between 0.0 and 0.25, although it depends heavily on the individual menu's content.
The shadow ratio controls what algorithms will be packed together in a module. Using a ratio of 0.5 means that all algorithms that contain at least 50 % of the same condition instances will be placed on the same module. Practical tests showed that this approach does not guarantee the most efficient distribution and should be used carefully (consider it as experimental). It is advised to start with a ratio of 0.0 and verify if higher ratios (up to 0.25) improve the chip resource usage.
tm-vhdlproducer L1Menu_sample.xml --modules 2 --dist 1 --ratio .25 # set ratio to 0.25To limit certain condition types to a subset of modules (or just a single
module) use the --constraint argument. Limit a condition type to a single module
tm-vhdlproducer L1Menu_sample.xml --modules 2 --dist 1 --constraint ext:0 # limit external conditions to module 0or to a subset of modules
tm-vhdlproducer L1Menu_sample.xml --modules 2 --dist 1 --constraint ext:2,4-6 # limit external conditions to modules 2, 4, 5 and 6List of supported condition constraints:
ext: external conditionszdc: both ZDC+ and ZDC- conditions
To try out different optimizations use the --dryrun flag to prevent writing
output to the filesystem.
tm-vhdlproducer L1Menu_sample.xml --modules 2 --dist 1 --dryrunL1Menu_sample-d1/
+-- doc/
| +-- L1Menu_sample-d1.html
| `-- L1Menu_sample-d1.twiki
+-- testvectors/
+-- vhdl/
| +-- module_0/
| | `-- src/
| | `-- *.vhd
| `-- ...
+-- xml/
| `-- L1Menu_sample-d1.xml
`-- tm-vhdlproducer.log
A TWiki page template and a HTML menu documentation is also written to the
doc/ directory in the output location.
All messages printed to the screen are written to a log file in the output
location (e.g. L1Menu_sample/tm-vhdlproducer.log).
VHDL template hierarchy for condition instances located in templates/vhdl/instances.
