I want to write a simple chisel3 blinking led design on my AC701 kit (artix7). But to do that I have to instantiate a clock input differential buffer. Xilinx give the following verilog template to do that :
IBUFDS #(
.DIFF_TERM("TRUE"),
.IOSTANDARD("DEFAULT")
) IBUFDS1_inst (
.O(clock1), // Clock buffer
.I(clock1_p), // Diff_p clock
.IB(clock1_n) // Diff_n clock
);
I read on chisel documentation that I have to use «blackbox» class to instantiate it. But I can't do it. I tried this :
class IbufdsParam extends VerilogParameters {
val DIFF_TERM = "TRUE"
val IOSTANDARD = "DEFAULT"
}
class IBUFDS extends BlackBox {
val params = new IbufdsParam()
val io = IO(new Bundle {
val O = Output(Bool())
val I = Input(Bool())
val IB = Input(Bool())})
io.O.setName("O")
io.I.setName("I")
io.IB.setName("IB")
/* For simulation */
io.O := io.I & ~io.IB
}
But it seem that chisel3 doesn't know VerilogParameters class :
[error] blinking_led/blink.scala:5: not found: type VerilogParameters
[error] class IbufdsParam extends VerilogParameters {
And I don't know how to say «do not use clock and reset with this module».
Once this blackbox correctly declared, I will have to connect the output clock ('O') to the main clock of my blinking module. I'm not sure about how to do that. I'm thinking about that :
class Blink extends Module {
val io = IO(new Bundle {
val clock_p = Input(Bool())
val clock_n = Input(Bool())
val led = Output(Bool())
})
val ibufds = IBUFDS()
Driver.implicitClock := ibufds.io.O
ibufds.io.I := io.clock_p
ibufds.io.IB:= io.clock_n
...
}
But I think it's maybe not the right way, isn't it ?