-
Notifications
You must be signed in to change notification settings - Fork 986
New Sta command called sta2 that can use delays from configs. #5278
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…erty files) to determine paths lengths.
fixed compiler warnings
Does this mean longest and shortest path for each source -> sink pair? If not that could be a problem since different FFs can have different setup/hold requirements. Meaning that, for example, if you take the shortest path from an FF to all it's consumers FFs that might be a path without hold violation. But a longer path to some specific FF could contain a violation. |
Mostly yes. It is possible to define a "delay" property for a FF. This gets added to the path at both ends. If somebody has the need to have accurate setup and hold constraints for FF it should be possible to add them. |
May I ask what the problem with the original |
The original STA command had, as far as i can tell, three issues:
It might have been possible to change the existing command to accommodate these three things. but keeping it backwards compatible would have been hard. Therefore I implemented it as a separate command, this way people can still use the STA command where it's usefull. |
Did you get
While I personally don't consider this an issue (if you have a hierarchical design, select the section you want to examine as top module, then run synthesis and sta), I accept this is a limitation for big designs.
Yes, and this is something we've discussed with them, because deriving modules is used everywhere. In Verilog specify syntax one can do
Well, you only have to change one thing now. To be honest, I think inside this PR are two much smaller PRs: a command to import specify delays, and |
I did not know that the specify2/3 construct exists. |
More programmatically? Uh, there doesn't appear to be an RTLIL helper for this, likely on the basis that specify rules were never expected to be added after the fact. So the Verilog front-end generates them directly: yosys/frontends/verilog/verilog_parser.y Line 1298 in 8634d83
I will admit I'm not that familiar with the internals of how this would be implemented, but I hope this is at least a little useful. |
The Because adding more work for the designer is not realistic in my eyes. |
At risk of asking the obvious question: what makes writing specify blocks infeasible, but writing your pseudo-liberty format containing the same information feasible?
Then you can modify But the problem that both your pseudo-liberty and Verilog specify formats have is that the actual Liberty timing model is far more complicated than either, depending on things like input slew and output capacitances.
I agree, to be clear. |
If we assume that we can write a generic specify block for each yosys internal cell then yes this is the same amount of effort. One other aspect that is important for PULP is that it should be possible to use the STA command early on in the flow. if possible already while higher level cells are in use. In that case the width of the input cells has to be considered. And I'm pretty sure the specify2/3 do not support this. Because they do not even use the input width parameters anywhere. Yes it might be possible to use the specify cells but the project would probably require:
Yes this might be possible to do. But I see no advantage over using liberty files. because Liberty files are also used to define timing. |
And then... how does your pseudo-liberty format somehow succeed where specify cells fail?
Okay, sure, although I think this is not as useful as you think it is. You might as well be printing random numbers.
Correct, they don't use the input width parameters, because they look at the signal widths instead. So they support this behaviour just fine. It's necessary to support syntax like
Based on the above, we can use them directly.
N/A.
N/A.
Sure.
Yep.
Yep.
See, here it feels like you haven't read what I said, so I'm going to repeat myself:
One has to translate the Liberty timing model into something Yosys can use - specify cells (to avoid confusion, let's refer to the Verilog syntax as "specify blocks") - and either write Verilog specify blocks to do this, or modify read_liberty to import Liberty timing into specify cells. (I'm fine with either approach.) |
Needs more integration with existing functionality in Yosys and deeper design discussions. This would best be done ahead of submitting a new PR so I'm closing this one |
On the request of @phsauter I have implemented a new STA Command that allows to read timing information from a config file.
It extracts the the longest/shortest path for each FF and then a report gets created with limitations according to the configuration.
For the configuration of the delays a modified liberty file is used. The user can provide their own definition of delay. for every cell type. It works for standard cells or also any yosys-internal cells. Early in the flows cells can be parameterised, they can have arbitrary widths. the config is built for that. It is possible to give one or two dimensional tables that represent the timing according to the width of the cells. for one dimensional tables it just takes the maximum width. if there is a two dimensional table one also needs to specify which port-widths get used as the indices.
For the output it is possible to specify the min and max pathlengths.
It will print all the paths longer as the max pathlength.
And it will print all the paths shorter then the min pathlength.
This can be used to extract all the setup and hold violations.
Due to the delays being part of the config file, it is possible to use any definition for that. I have used a nand2 gate as a reference and created configurations for any cell type using that as a base. But it would be possible to use any other definition.
I have created the following three definitions:
IHP130 standard cells: ihp130_stdcell.lib.txt
Yosys internal cells (which are used after techmap): nand2_based_internal_delay.lib.txt
Yosys internal cells (before techmap): by_width.lib.txt
This command produces outputs such as this:
large_verbosity.sta.txt
middle_verbositry.sta.txt
no_verbosity.sta.txt
There is currently the following problem with the generated report:
The design needs to be flattened first. This is done internaly in the sta2 command. But this generates a lot of output. This output gets printed in the same place as the timing report. This is not ideal. But i have no idea how this could be fixed.
As this is part of a small thesis I also have a report some other background work. if needed I can provide this aswell.
There is also a python generator for generating the lib file for pre-techmap, which uses nand2 equivalent delays. Adjusting it for any other concept of delay wouldn't be a problem. I'm not sure where this should be published if at all. liberty_generator.py.txt