I am making a digital clock, and when I press switch 0 on the digital clock, the order changes to mode clock operation, mode clock setting, and mode alarm setting. And these changing modes should be displayed as they are on the text LCD. What should I do?
`include"textgen.v"module tb_textgen;// Inputsreg[1:0] i_mode_lcd;reg i_clk;reg i_rstn;// Outputswire o_line_data_valid;wire[16*8-1:0] o_line_data1;wire[16*8-1:0] o_line_data2;// Instantiate the textgen module
textgen
u_textgen(
.o_line_data_valid(o_line_data_valid),
.o_line_data1(o_line_data1),
.o_line_data2(o_line_data2),
.i_mode_lcd(i_mode_lcd),
.i_clk(i_clk),
.i_rstn(i_rstn));// Clock generationalwaysbegin#5 i_clk =~i_clk;// 100MHz clockend// Stimulusinitialbegin// Initialize inputs
i_clk =0;
i_rstn =0;
i_mode_lcd =2'b00;// Start with MODE_CLOCK_OPR// Apply reset#10 i_rstn =1;// Test case 1: MODE_CLOCK_OPR#10 i_mode_lcd =2'b00;// Set mode to clock operation#100;// Wait for a few clock cycles// Test case 2: MODE_CLOCK_SET#10 i_mode_lcd =2'b01;// Set mode to clock set#100;// Test case 3: MODE_ALARM_SET#10 i_mode_lcd =2'b10;// Set mode to alarm set#100;// Test case 4: Default case (no mode)#10 i_mode_lcd =2'b11;// Invalid mode#100;// End simulation$finish;end// Monitor output signalsinitialbegin$monitor("At time %t, o_line_data_valid = %b, o_line_data1 = %h, o_line_data2 = %h",$time, o_line_data_valid, o_line_data1, o_line_data2);endreg[8*32-1:0] vcd_file;initialbeginif($value$plusargs("vcd=%s", vcd_file))begin$dumpfile(vcd_file);$dumpvars;endelsebegin$dumpfile("wave_text.vcd");$dumpvars;endendendmodule
@MICHIN
You have shared with us your project requirements (which is probably given to you by your teacher) and your code.
But did you compile your design and get a problem?
The simulator tool is a complier of the testbench and the DUT and tells you if something is wrong or if it compiles correctly, will show you if your DUT is behaving the way as it should.
For me it is not possible to create a project and compile the design for you to find out your mistakes. That is your task!
Find it out and then come back here with specific problems giving adequate information.