EDA Playground lets you type in and run HDL code (using a selection of free and commercial simulators and synthesizers).
It's great for learning HDLs, it's great for testing out unfamiliar things and it's great for sharing code.
You can start typing straight away. But to run your code, you'll need to sign or log in. Logging in with a Google account gives you access to all non-commercial simulators and some commercial simulators:
To run commercial simulators, you need to register and log in with a username and password. Registration is free, and only pre-approved email's will have access to the commercial simulators.
* not available.
206
module Test (input bit[7:0] Addr, Data);
initial
#100 $stop;
endmodule
module CheckAddr (input clk, bit[7:0] Addr, Max);
default clocking cb @(posedge clk); endclocking
A1: assert property (Addr <= Max)
else $error("Address is out of range");
endmodule
module DUT_TB;
bit[7:0] Addr, Data;
bit clk;
assign #5 clk = (clk == 1'b1 ? 1'b0 : 1'b1);
assign #10 Addr = Addr + 1;
DUT dut_inst (clk, Addr, Data);
// Binds an instance of the module Test to the testbench
bind DUT_TB Test Test_inst(Addr, Data);
// Binds an instance of the module CheckAddr to the DUT instance
bind DUT_TB.dut_inst CheckAddr CA_inst1(clk, Addr, Data);
// Alternative syntax for the above
bind DUT: dut_inst CheckAddr CA_inst2(clk, Addr, Data);
// Dump waves
initial begin
$dumpfile("dump.vcd");
$dumpvars(1, DUT_TB.dut_inst);
end
endmodule
xxxxxxxxxx
module DUT (input clk, bit[7:0] Addr,
output bit[7:0] Data);
always @(posedge clk)
begin
Data = Addr + 1;
end
endmodule
Your account is not validated. If you wish to use commercial simulators, you need a validated account.
If you have already registered (or have recently changed your email address), but have not clicked on the link in the email we sent you, please do so. If you cannot find the email, please check your spam/junk folder. Or click here to resend the email.
If you have not already registered for a full account, you can do so by clicking below. You will then need to provide us with some identification information. You may wish to save your code first.
Creating, deleting, and renaming files is not supported during Collaboration. To encourage development of these features for Collaboration, tweet to @EDAPlayground
This playground may have been modified. Please save or copy before starting collaboration.
Your exercise has been submitted.