Closed ninehusky closed 1 week ago
I'll try to dig into this a little bit tonight!
The bug is here: https://github.com/uwsampl/churchroad/blob/cb9195421c4c58070a4b964cd5636b8198250750/yosys-plugin/churchroad.cc#L1558-L1559
Basically, we're extending the inputs before the concat, which is useful e.g. when implementing things like Add and And (i.e. ops where the inputs and output are all the same bitwidth), but Concat does not have the same behavior. It's output bitwidth is the sum of its input bitwidths. thus, the inputs don't need to be extended to match the output bitwidth.
When using the Churchroad Yosys plugin, I'm seeing that there are multiple
ZeroExtend
s that aren't correct. Consider the following module:Running
yosys -m $CHURCHROAD_DIR/yosys-plugin/churchroad.so -q -p "read_verilog -sv my-module.v; prep -top my_module; pmuxtree; write_lakeroad"
yields:v2
, which is the output of the module, is being assigned the concatenation ofv3
andv4
, each of which are respectivelya
andb
zero-extended to be of bitwidth 2. This means that we're unioning two things of different bitwidth!