B-Lang-org / bsc

Bluespec Compiler (BSC)
Other
925 stars 142 forks source link

Conflicting scheduling annotation in Library and reference guide for DRegA/U #547

Open pawks opened 1 year ago

pawks commented 1 year ago

The scheduling annotation for mkDRegA and mkDRegU in the guide for write vs write is mentioned to be SBR but the actual annotation during use turns out to be C. The problem arises due to the underlying wire variant which is used inside the modules. The mkRWireSBR is used in mkDReg (ref) while the mkRWire is used in the other two(ref).

quark17 commented 1 year ago

Thank you! I did some investigating and I can't see why the other modules aren't SBR, too. We should change them to use mkRWireSBR. And the tests in testsuite/bsc.lib/dreg/ could also be extended to check the scheduling annotations.

The library was originally written using mkRWire for all three and then someone updated mkDReg in 2010 to make its write method SBR, to match ordinary mkReg. That commit didn't change the other two, but I don't see any reason why. I can't find any internal Bluespec Inc emails talking about it. I'd guess it was just an oversight.