ZipCPU / wb2axip

Bus bridges and other odds and ends
495 stars 100 forks source link

restore default nettype to wire #28

Closed akukulanski closed 4 years ago

akukulanski commented 4 years ago

Hi Dan,

Many modules set the define for default nettype to none, and while I agree it's a good practice to have it set this way, it becomes a problem when integrating any of these into a project with 3rd party modules that may not specify the nettype for wires (since the scope of the define is global). In this PR I'm simply restoring the default nettype to wire at the end of each file that set it to "none" to limit the scope of it, in case you consider it appropriate. I saw it is done in some places only for synth without Yosys, I'm not sure why but I kept it the same way for consistency.

akukulanski commented 4 years ago

ok, I see opened the other issue of this repo and this was addressed. Fastest closing ever. Sorry for the noise

ZipCPU commented 4 years ago

I'm not sure what you saw that addressed the issue, because I'm still having issues with this.

With my tools, if I leave default_nettype at wire, I'm struggling with bugs that aren't caught. If I switch it to wire at the end of the file, Yosys treats the whole file as default-nettype wire (contrary to spec).

As a result, I'm slowly transitioning the repository back to default_nettype of none and removing the ifdef YOSYS lines at the bottom that set it back to wire.

I'm not sure I know of a good answer to this issue.

Dan

akukulanski commented 4 years ago

Yes, I wasn't accurate, I meant that I understood why adding it at the end of the file wasn't a good solution. I don't see a way of solving this while Yosys remains with that behavior. Having it set to none globally seems the best option as long as you can do it.