Skip to content
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

Cocotb directives in Verilog backend #674

Open
Martoni opened this issue Mar 10, 2016 · 2 comments
Open

Cocotb directives in Verilog backend #674

Martoni opened this issue Mar 10, 2016 · 2 comments

Comments

@Martoni
Copy link
Contributor

Martoni commented Mar 10, 2016

I'm using cocotb to write my testbench. Because it's in python and it's easier than writing verilog testbench.
But to simulate verilog generated by chisel I have to modify the module generated to add timescale :

`timescale 1ps/1ps

In the top of source.

And vcd directive in the end of module

module MyModule (...);

[...]

`ifdef COCOTB_SIM
initial begin
  $dumpfile ("MyModule.vcd");
  $dumpvars (0, MyModule);
  #1;
end
`endif
endmodule

To dump vcd file.

Is there a way for generating it with the chisel backend (with a special option for example) ?

@aswaterman
Copy link
Member

You can put this code in a separate .v file, which also 'includes the .v
chisel emits.

On Thursday, March 10, 2016, Martoni [email protected] wrote:

I'm using cocotb https://github.com/potentialventures/cocotb to write
my testbench. Because it's in python and it's easier than writing verilog
testbench.
But to simulate verilog generated by chisel I have to modify the module
generated to add timescale :

`timescale 1ps/1ps

In the top of source. And this in module

module MyModule (...);

[...]
ifdef COCOTB_SIMinitial begin $dumpfile ("MyModule.vcd"); $dumpvars (0, MyModule); #1;endendifendmodule

To dump vcd file.

Is there a way for generating it with the chisel backend (with a special
option for example) ?


Reply to this email directly or view it on GitHub
#674.

@Martoni
Copy link
Contributor Author

Martoni commented Mar 11, 2016

@aswaterman Yes I do that, but with this solution I need to maintain one more source file.
I wrote a little quick&dirty python script to add these lines just after the scala verilog generation if somebody is interested by it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants