sifive / duhportinf

🐉 DUH port inference package
https://github.com/sifive/duh
Apache License 2.0
3 stars 3 forks source link

bidirectional port mapping by duh-portinf #14

Open RyanSangdeokPark opened 4 years ago

RyanSangdeokPark commented 4 years ago

I got a problem when I try to update my duh doc using duh-portinf. if duh doc includ inout port, port interface is not updated normally and printed out below error message.


  File "/sifive/tools/sifive/duh/1.16.4/node_modules/duhportinf/pylib/duhportinf/util.py", line 20, in format_ports
    w, d = np.abs(pw), np.sign(pw)
TypeError: bad operand type for abs(): 'dict'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/sifive/tools/sifive/duh/1.16.4/node_modules/.bin/duh-portinf", line 16, in <module>
    duhportinf.main_portinf.main()
  File "/sifive/tools/sifive/duh/1.16.4/node_modules/duhportinf/pylib/duhportinf/main_portinf.py", line 210, in main
    unassn_ports = util.get_unassigned_ports(args.component_json5)
  File "/sifive/tools/sifive/duh/1.16.4/node_modules/duhportinf/pylib/duhportinf/util.py", line 49, in get_unassigned_ports
    all_ports = format_ports(block['component']['model']['ports'])
  File "/sifive/tools/sifive/duh/1.16.4/node_modules/duhportinf/pylib/duhportinf/util.py", line 23, in format_ports
    w, d = None, np.sign(-1) if pw[0] == '-' else np.sign(1)
KeyError: 0```

This is simple example of component
......
     DDR_PHY_Xdram_CK: {
         direction: 'inout',
      },
      DDR_PHY_Xdram_CKB: {
        direction: 'inout',
      },
......

I installed duh 1.16.4 (npm duh@1.16.4)
Ramlakshmi3733 commented 4 years ago

this issue is not specific to bidirectional the python code for duhportinf does not support the expanded version of the direction

Ramlakshmi3733 commented 4 years ago

i have created issue14 branch that addresses this issue. but i have not created a pull request until i have completed all the testing.