-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
../../rtl/common/cs_gen.v:8: error: Concatenation repeat may not be negative (-2). #2
Comments
This doesn't reproduce for me using the latest master and the oldland-buildenv docker image. The repetitions in question are created from the yaml configs (check the various *_defines.v in the config subdir inside the build directory). It might be that the yaml wasn't processed correctly if you haven't changed anything - do you have any errors earlier in the build for missing tools perhaps? |
Debugging the verilog I suspect code like what we have in keynsham_irq might be the problem. cs_gen #(.address(bus_address), .size(bus_size)) This will in cs_gen.v set Am I missing something? |
Ah! I did not see your reply while composing my message.
|
cs_mask_bits will only be 32 if the chip select covers the whole 32 bits and that doesn't happen anywhere, most are only around 4KB. When you say that the defines are generated correctly, are the contents valid e.g.: `define SDRAM_CTRL_SIZE 32'h1000 which should give cs_mask_bits of 12. |
Yes, I am seeing the following data/oldland/oldland-cpu/BUILD/config/sdram_ctrl_defines.v:`define SDRAM_CTRL_SIZE 32'h1000 |
Okay, that's normal. Check the other defines and see if there is an unexpectedly large or small size. Knowing which instance of cs_gen this is occurring for will make it easier to debug. |
Other than the SDRAM size other numbers look ok. config/bootrom_defines.v: |
That all looks fine to me and I can't reproduce it here so you might need to try minimising the design to find out where it's going wrong. |
Ok. I will try to debug this further... I ran Make with --trace option and it failed on this command cd /prj/dyumnin/designw.in/hdl/BUILD/data/oldland/oldland-cpu/verif/icarus && BUILD_DIR=/prj/dyumnin/designw.in/hdl/BUILD/verif/icarus iverilog -Wall -Wno-sensitivity-entire-array -I/prj/dyumnin/designw.in/hdl/BUILD/verif/icarus -I/prj/dyumnin/designw.in/hdl/BUILD/verif/icarus/../../config -DOLDLAND_ROM_PATH="/usr/local/lib/" -c /prj/dyumnin/designw.in/hdl/BUILD/data/oldland/oldland-cpu/verif/icarus/oldland.cf -o /prj/dyumnin/designw.in/hdl/BUILD/verif/icarus/keynsham.vvp I next tried generating the output of the preprocessor (-E flag) and checked the size values passed to the modules instantiated in keynsham_soc module. These look ok. I tried constructing my own .cf file using the preprocessor output and iverilog was able to compile it. So the next step would be figuring out why it works with the preprocessor output and not with the original code. |
I think I found it, iverilog see's 2 toplevel modules cpu_tb and simuart. simuart has a cs_gen instance at the toplevel which causes this problem. |
I am getting the above error message while running make.
Note: I am not using the docker image,
The complete log is as follows
master ✗ f3a9d8a 807d △ ➜ make keynsham
[ 33%] Built target gendefines
[100%] Built target generate
../../rtl/common/cs_gen.v:8: error: Concatenation repeat may not be negative (-2).
1 error(s) during elaboration.
verif/icarus/CMakeFiles/keynsham.dir/build.make:57: recipe for target 'verif/icarus/CMakeFiles/keynsham' failed
make[3]: *** [verif/icarus/CMakeFiles/keynsham] Error 1
CMakeFiles/Makefile2:400: recipe for target 'verif/icarus/CMakeFiles/keynsham.dir/all' failed
make[2]: *** [verif/icarus/CMakeFiles/keynsham.dir/all] Error 2
CMakeFiles/Makefile2:412: recipe for target 'verif/icarus/CMakeFiles/keynsham.dir/rule' failed
make[1]: *** [verif/icarus/CMakeFiles/keynsham.dir/rule] Error 2
Makefile:240: recipe for target 'keynsham' failed
make: *** [keynsham] Error 2
The text was updated successfully, but these errors were encountered: