Referencing the implicit clock and reset?

797 views
Skip to first unread message

Jens Korinth

unread,
Jul 9, 2014, 3:47:09 AM7/9/14
to chisel...@googlegroups.com
Hi *!

Existing Verilog modules often do not use .clk and .reset as port names - is there any way to explicitly reference the clock and reset signals automatically generated for Chisel modules? I've got a BlackBox for an existing Verilog module with a Bundle similar to

val io = new Bundle {
  val s_clk = Bool(INPUT)
  val s_rstn = Bool(INPUT)
}

And what I'd like to do is:

io.s_clk := clk
io.s_rstn := ~reset

Is this possible (without modifying the generated Verilog code manually)? Could I, e.g., somehow use an explicit clock to achieve this?

Thanks in advance!
Jens

Christopher Celio

unread,
Jul 9, 2014, 5:20:38 PM7/9/14
to chisel...@googlegroups.com
In Chisel, reset is already in scope for you to use at will.

io.s_rstn := ~reset

I'm not sure about clock, I don't have any experience with multiple-clock domain stuff which may give you access to clock too. 

-Chris

Kamyar Mohajerani

unread,
Jul 10, 2014, 6:24:06 PM7/10/14
to chisel...@googlegroups.com
Wouldn't addClock(Driver.implicitClock)and addResetPin(Driver.implicitReset) do the job? I guess you could use any other user-defined clock/reset as arguments.

Kamyar


--
You received this message because you are subscribed to the Google Groups "chisel-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chisel-users...@googlegroups.com.
To post to this group, send email to chisel...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/chisel-users/8cee5410-0667-49ab-bccf-06d59ac76f12%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Jens Korinth

unread,
Jul 11, 2014, 2:02:13 PM7/11/14
to chisel...@googlegroups.com
@Chris: Thanks, you're right, I can reference the reset directly!

@Kamyar: Not really; but this is a nice trick to get the clk signal, even if you do not have any registers in the module, I'll keep it in mind. But it does not allow me to re-route the clock to a different port.

Reply all
Reply to author
Forward
0 new messages