SymbiFlow / yosys

SymbiFlow WIP changes for Yosys Open SYnthesis Suite
http://www.clifford.at/yosys/
ISC License
37 stars 9 forks source link

[Branch] attributes-on-parameters #41

Open mithro opened 5 years ago

mithro commented 5 years ago

Why did we need this? (what does this change enable us to do)

Enables Verilog attributes to be used on parameters.

What did it change?

The Yosys RTIL to support attributes on parameters.

Should it be merged upstream - if not, when can we delete it?

Unknown.

More Info

See https://github.com/SymbiFlow/yosys/issues/27

litghost commented 5 years ago

I believe this branch can be deleted, and I thought I had.

mithro commented 5 years ago

@litghost - Upstream Yosys only has the ability to ignore attributes on parameters? This is full attribute on parameters support with tests...

litghost commented 5 years ago

@litghost - Upstream Yosys only has the ability to ignore attributes on parameters? This is full attribute on parameters support with tests...

I do not know, but I believe upstream yosys implemented another way to hold attributes on parameters?

eddiehung commented 5 years ago

read_verilog -pwires preserves parameter values as constant driven wires. I'm not sure if it moves param attributes onto those wires, if not, can be easily fixed.

Can you provide more justification about what this enables, and/or a use case? Perfect round trip with Verilog in and Verilog out is not, in general, something synthesis tools can be expected to be good at since their purpose in life is to perform transformations.

mkurc-ant commented 4 years ago

I managed to modify the verilog backend to output all "parameters as wires" properly as verilog parameter statements. The option can be enabled in the verilog backend by specifying the -pwires2params switch. I've also added support for writing string parameter values as strings (not as integers) and real values as numbers.

There is also a test for verilog round trip which runs a verilog file twice through Yosys. Then it compares whether outputs after 1st and 2nd pass are equal.

I've created a new branch with this change: https://github.com/SymbiFlow/yosys/commits/attributes-on-parameters2

GitHub
SymbiFlow/yosys
SymbiFlow WIP changes for Yosys Open SYnthesis Suite - SymbiFlow/yosys