Using the verilog(freechips.rocketchip.system.DefaultConfig.v) in rocket-chip - vsim - generated-src

1,367 views
Skip to first unread message

Chinmaya Dash

unread,
Nov 24, 2017, 11:09:48 PM11/24/17
to RISC-V HW Dev
Hi RISC-V HW Developers,

This is my first post here. So as a quick introduction: I would say that I have good digital design experience. I had university courses on Processors and have designed simple processor core. I am new to processor SoC designs.

I am trying to understand Rocket-Chip so that I will be able to customize it, eventually to make it a part of a product idea we are evaluating.


I jumped straight to the generated verilog with Default configuration. I don't have vcs license; I took the verilog for implementation on to Xilinx Vivado. Following queries are from my implementation attempt-

1. plusarg_reader:
There are multiple instances of plusarg_reader module. The definition is missing. I commented it out for my implementation. What does this block do? 
plusarg_reader #(.FORMAT("tilelink_timeout=%d"), .DEFAULT(0)) plusarg_reader (.out(plusarg_reader_out) ); 

2. module 'AsyncResetReg' not found
I defined this module. As the name says, I defined a D flipflip with synchronous enable and asynchronous reset. However as another discussion is going on - https://groups.google.com/a/groups.riscv.org/forum/?utm_medium=email&utm_source=footer#!msg/hw-dev/Am1dN06FCns/_oxu0DX8BAAJ
It seems resets are synchronous. Can you please clear the confusion here.

3. While synthesizing the ram-
reg [63:0] ram [33554431:0]
vivado complained that -
ERROR: [Synth 8-354] integer overflow when computing array size [src/freechips.rocketchip.system.DefaultConfig.behav_srams.v:248]
I have reduced the size by half and address bits by 1.
Any comments on this?

4. module 'SimDTM' not found
What is this module for?
The top module in generated-src is TestHarness. Is it a module that contains testbench?
My current top is 'ExampleRocketSystem'.
Other than the rocket wrapper tile there are many blocks. What is the best way for me to understand these blocks?

Any help is highly appreciated.
Regards
Chinmaya

Kimura Masayuki

unread,
Nov 25, 2017, 2:52:38 AM11/25/17
to Chinmaya Dash, RISC-V HW Dev
Hi, 

plusarg_reader.v and AsyncResetReg.v is at ./vsrc directory.

And, my understanding is that Rocket Chip generated file in emulator directory is only for verilog simulation.
and we have to replace behavior RAMs defined in "freechips.rocketchip.system.DefaultConfig.behav_srams.v" into SRAM or BlockRAM.

By default, behav_srams.v is generated due to FIRRTL options that is convert Chisel description into Verilog.
If you change following Makefile, you can avoid to generate behave_sram.v instead of default memory.
- emulator/Makefrag-verilator:
 %.v %.conf: %.fir $(FIRRTL_JAR)
        mkdir -p $(dir $@)
-       $(FIRRTL) $(patsubst %,-i %,$(filter %.fir,$^)) -o $*.v -X verilog --infer-rw $(MODEL) --repl-seq-mem -c:$(MODEL):-o:$*.conf -faf $*.anno -ffaaf
+       $(FIRRTL) $(patsubst %,-i %,$(filter %.fir,$^)) -o $*.v -X verilog

For your convenience, I recommend you can use fpga-zynq repository (https://github.com/ucb-bar/fpga-zynq) for FPGA implementation.
This repository also includes "rocket-chip" as subrepository. But relatively old design is used.

I succeeded to synthesize from rocket-chip directory but my feeling is that it is little bit hard to implement on FPGA from "native" rocket-chip repository.

Thanks.
Masayuki Kimura


2017年11月25日(土) 13:09 Chinmaya Dash <chinmaya...@gmail.com>:
--
You received this message because you are subscribed to the Google Groups "RISC-V HW Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hw-dev+un...@groups.riscv.org.
To post to this group, send email to hw-...@groups.riscv.org.
Visit this group at https://groups.google.com/a/groups.riscv.org/group/hw-dev/.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/hw-dev/80d4bf76-26b1-4c5e-bfee-6622789f6fa5%40groups.riscv.org.

Chinmaya Dash

unread,
Nov 30, 2017, 9:14:14 PM11/30/17
to RISC-V HW Dev, chinmaya...@gmail.com
Thanks a lot Masayuki.
I see that all files required for behavioral simulation are present in vsrc directory.

I can compile the ExampleRocketSystem top module.
However the TestHarness top gives me errors as there are some libraries that need to be linked.
[The source of problem is that I built the RocketChip in ubuntu enviornment in one computer and I am trying to get simulations going on in another computer where I have Cadence licenses by copying over files and directories].

I have a more general request.
To start with I want to be able to execute a small 'internal register addition' c-code on the processor.
What steps should I do?
I will actually put it as another query.

Thanks
Chinmaya


Ghada Dessouky

unread,
Nov 12, 2019, 12:17:57 PM11/12/19
to RISC-V HW Dev, chinmaya...@gmail.com
Hi,

So I am also now running into the same "integer overflow" error for the memory when synthesizing the SRAM - how did you eventually fix that?

Best,
Ghada

Frederick HONG

unread,
Apr 6, 2020, 12:22:42 AM4/6/20
to RISC-V HW Dev, chinmaya...@gmail.com
Hi Masayuki,

Maybe you could elaborate on how do you synthesize the verilogs generated from rocketchip? And how do you replace the behav_sram.v? Any details? Really appreciate it!
To unsubscribe from this group and stop receiving emails from it, send an email to hw-...@groups.riscv.org.

穿山羊

unread,
Nov 9, 2020, 8:40:52 AM11/9/20
to RISC-V HW Dev, chinmaya...@gmail.com
I wan to run a simulation on vivado. But I got all "X's".  Did you met the same problem?
Reply all
Reply to author
Forward
0 new messages