Closed ganeshgore closed 3 months ago
This test seems to be wrong according to is_downto
assumption
https://github.com/byuccl/spydrnet/blob/d5b9bd8313dce511fdc583c3451d290ba0ac3178/tests/spydrnet/parsers/verilog/tests/test_verilogParser.py#L602-L603
I think we can do this, there are two approaches https://github.com/byuccl/spydrnet/blob/d5b9bd8313dce511fdc583c3451d290ba0ac3178/tests/spydrnet/parsers/verilog/tests/test_verilogParser.py#L737
Maintaining the consistency between the Verilog index and Python list index
[1:0]sample_c
or [0:1]sample_c, in both scenarios the python list sample_c.wire[0]
points to verilog net sample_c[0]
and sample_c.wire[1]
points to verilog net sample_c[1]
is_downto
property Is changed we need to reverse the _wires
list, it can be achieved by extending is_downto
property definition in bundle.py
Consider is_donwto
argument only during parsing and composing
[1:0]sample_c
declaration will be parsed as sample_c.wire[0]
->sample_c[0]
and sample_c.wire[1]
->sample_c[1]
but declaration will be parsed as
sample_c.wire[0]->
sample_c[1]and
sample_c.wire[1]->
sample_c[0]`is_downto
flag will be used to get the correct index is_downto
flag changing during the manipulationI can fix this I would like to know which one is the preferred implementation
Thanks for submitting this. Which approach did you take in your pull request #222 ?
I went with the first option that seems less intrusive.
I am still checking different cases, if you want please close this I will create new issue if I find any new bug
In the current master branch, the following netlist with big-endian bundle declaration is incorrectly handled.
My understanding is then big-endian bundle is defined
is_downto=False
and pins will be placed in reverse order in the python list. For example, in the following example. the python list for cableupto.wires[0] = <verilog_net_of_upto[1]>
upto.wires[0] = <verilog_net_of_upto[0]>
Input netlist
Output netlist