Hello Anoop,
These are reasonable questions and its a little difficult to understand how this system works without examples. Fortunately the open source technologies supported by hammer provide a few.
If you are looking to use a fixed set of SRAMs (not generating new ones) then you will want to use the MACROCOMPILER_MODE as a cache.
If you are following the standard Hammer directory structure for a tech plugin (which I would recommend) then simply setting tech_name to the name of your technology will cause the makefile to expand and automatically set tech_dir, which will cause SMEMS_CACHE(see the top of
vlsi/Makefile) to point to the MDF description of your SRAMs.
This JSON file is a serialized representation of the SRAMMacro objects that correspond to your set of available SRAMs. You can see some examples for
asap7 and
nangate45.
These objects enable barstools to match the available ports on your SRAMs with the requested functionality of your Chisel memories.
Barstools will then generate any extra logic needed to map to your available SRAMs.
You will also want to include the SRAM collateral in your Hammer configuration, which can be automatically generated using the sram_compiler abstraction (asap7
example), which can work even with what Barstools "cache" configurations. This process could be annoying or difficult if your collateral is not regularly named or located in widely varied locations, or has other irregularities. In this case you can write the Hammer configuration of the collateral by hand. At the end of this process you will have the same file either way, but it is a lot more effort to maintain the hand crafter version.
Hopefully this helps expand on the process of including foundry memories in Chipyard designs with Hammer. Let me know if you have further questions.
Thanks,
Colin