cms-L1TK / project_generation_scripts

Python scripts to generate the wiring map of the tracklet pattern recognition & the top-level HDL that calls the HLS modules in the Hybrid Chain.
1 stars 2 forks source link

Remove unwanted nEntries ports, update unusedproj.dat, use tf_mem*.vhd & tf_pkg.vhd #14

Closed tomalin closed 3 years ago

tomalin commented 3 years ago

1) Removed unwanted nEntries ports at inputs of memories and anything connected to them. 2) Switch to using Robert's VHDL memories tf_mem*.vhd that have these nEntries ports removed, and his VHDL utility functions & aliases tf_pkg.vhd . The VHDL produced by the scripts is therefore reliant on being compiled with the repo https://github.com/cms-L1TK/firmware-hls/tree/HDLTopSim/IntegrationTests/common/hdl . 3) Added new script MakeUnusedProj.sh to produce unusedproj.dat containing list of TPROJ memories that C++ emulation says contain no data, so should not be connected up. 4) Suppressed nEntries output port from AP & AS memories, since the subsequent processing modules don't need them. 5) Allow several processing modules to share a single HLS IP Core. 6) Runs the python version of ROOT, avoiding the need for an os.system() call to ROOT. 7) Minor bug fixes (e.g. to fix parsing of top-level HLS function arguments, where "split by comma" could fail if arguments were templated)

Together with https://github.com/cms-L1TK/project_generation_scripts/pull/13 , this makes the scripts compatible with the latest HLS code.

pwittich commented 3 years ago

One thing I noticed while running the code on an earlier implementation was some confusion in my mind about from where the scripts should be run. I wonder if this is still the case, and if it makes sense to either use some sort of environment variable or tests to ensure that the scripts are launched from the expected directories.

tomalin commented 3 years ago

One thing I noticed while running the code on an earlier implementation was some confusion in my mind about from where the scripts should be run. I wonder if this is still the case, and if it makes sense to either use some sort of environment variable or tests to ensure that the scripts are launched from the expected directories.

1) The README.md file was clarified recently. e.g. It recommends running the command "./HourGlassConfig.py", which makes it clear that the user should be in the directory where the HourGlassConfig.py is. 2) I've checked that generator_hdl.py throws an exception, with sensible error message, if it fails to find the HLS code in the expected directory. The README file clarifications also make it clearer where the user should put the HLS code. 3) generator_hdl.py now directly uses the python version of ROOT. The line "import ROOT" causes an ugly crash, if the user forgot to put ROOT in their PATH, (the README tells them to). If desired, it could instead throw an exception with sensible error message using the method https://stackoverflow.com/questions/14050281/how-to-check-if-a-python-module-exists-without-importing-it , but there would then no longer be an "import ROOT" statement, which may confuse people.

tomalin commented 3 years ago

Took a while to review, github highlighting changed lines in a confusing way. Nevertheless all changes look good, and perform as expected.

Thanks Derek. @pwittich are you happy if we merge?

pwittich commented 3 years ago

Took a while to review, github highlighting changed lines in a confusing way. Nevertheless all changes look good, and perform as expected.

Thanks Derek. @pwittich are you happy if we merge?

looks great to me