mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 22:02:55 +01:00
Add missing samples
This commit is contained in:
parent
26ff8cb857
commit
db4c9f21b4
52 changed files with 5060 additions and 540 deletions
35
website/index/samples/sample.verilog.txt
Normal file
35
website/index/samples/sample.verilog.txt
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
`include "first_counter.v"
|
||||
module first_counter_tb();
|
||||
// Declare inputs as regs and outputs as wires
|
||||
reg clock, reset, enable;
|
||||
wire [3:0] counter_out;
|
||||
|
||||
// Initialize all variables
|
||||
initial begin
|
||||
$display ("time\t clk reset enable counter");
|
||||
$monitor ("%g\t %b %b %b %b",
|
||||
$time, clock, reset, enable, counter_out);
|
||||
clock = 1; // initial value of clock
|
||||
reset = 0; // initial value of reset
|
||||
enable = 0; // initial value of enable
|
||||
#5 reset = 1; // Assert the reset
|
||||
#10 reset = 0; // De-assert the reset
|
||||
#10 enable = 1; // Assert enable
|
||||
#100 enable = 0; // De-assert enable
|
||||
#5 $finish; // Terminate simulation
|
||||
end
|
||||
|
||||
// Clock generator
|
||||
always begin
|
||||
#5 clock = ~clock; // Toggle clock every 5 ticks
|
||||
end
|
||||
|
||||
// Connect DUT to test bench
|
||||
first_counter U_counter (
|
||||
clock,
|
||||
reset,
|
||||
enable,
|
||||
counter_out
|
||||
);
|
||||
|
||||
endmodule
|
||||
Loading…
Add table
Add a link
Reference in a new issue