Hi,
Recently I used the following Verilog code in my project:
module dff8(
input wire CLK,
input wire RST,
input wire [7:0] D0,
output reg [7:0] Q0
);
always @( posedge CLK or negedge RST ) begin
if ( RST == 1'b0 ) begin
Q0 <= 8'b0;
end else begin
Q0 <= #10 D0;
end
end
endmodule
Is there any way how to model #<DELAY> in SystemC. The example of systemc register that I use is below.
SC_MODULE(dff8)
{
// port declarations
sc_in<bool> CLK;
sc_in<bool> RST;
sc_in<sc_uint<8> > D0;
sc_out<sc_uint<8> > Q0;
// process declaration
void do_dff8()
{
if (RST.read() == 0)
{
Q0.write(0);
}
else
{
// HOW TO ADD DELAY HERE?
Q0.write(D0.read());
}
}
SC_HAS_PROCESS(dff8);
dff8(sc_module_name inst)
: sc_module(inst)
{
SC_METHOD(do_dff8);
sensitive << CLK.pos();
sensitive << RST.neg();
}
};
Thanks for any help.