Tui la dan thiet ke IC, dang lam trong team Verification. Mong la topic nay giup duoc cac ban va giup duoc chinh ban than tui?? Bat dau ne: cau truc cua mot testbench bang verilog la???START
// Debug output ports on the chip. These are just internal signals brought out so // they can be observed. // vn08chip_gez vn08chip_gez ( .clk_i(clk), .clkwdt_i(clkwdt), .por_i(por), .mclr_i(mclr), .prgdata_i(prgdata), .extint_i(extint), .t0cki_i(t0cki), .t1cki_i(t1cki), .ccp1i_i(ccp1i), .rxdti_i(rxdti), .rxcki_i(rxcki), .wdte_i(wdte),
.prgaddr_o(prgaddr), .sleep_o(sleep), .ccp1o_o(ccp1o), .txdto_o(txdto), .txcko_o(txcko), .porta(porta), .portb(portb), .portc(portc), .portd(portd) ); // Instantiate the program memory. rom64k rom64k( .prg_addr(prgaddr), .prg_data(prgdata) );
// Instantiate the RAM512
// This is the only initial block in the test module and this is where // you select what test you want to do.
initial begin $display ("************* VN8_01 ***************************"); basic; end
//initial begin //$sdf_annotate ("sigmak3.mapped.sdf", sigmak3); //end
// Event should be emitted by any task to kill simulation. Tasks should // use this to close files, etc. // event ENDSIM;
// Capture some data task capture_data; begin $vcdplusfile("tb_chip_basic.vpd"); $dumpvars (0, tb_chip_basic); $vcdpluson; $vcdplusdeltacycleon; @(ENDSIM); $dumpflush; end endtask
//------------------------- task reset_por; begin por = 0; # (5*CLKLO) por = 1; $display ("End RESET_POR."); end endtask //================================= //Reset master clear task reset_pic; begin mclr = 1; #(5*CLKLO) mclr = 0; #(5*CLKLO) mclr = 1; $display ("End RESET_MCLR."); //#(700*CLKLO) mclr = 0; //#(20*CLKLO) mclr = 1; //#(94000*CLKLO) mclr = 0; //#(6*CLKLO) mclr = 1; end endtask
// Drive the clock input task drive_clock; begin clk = 0; forever begin #(CLKLO) clk = ~clk; end end endtask
//-------------------------------- task drive_t0cki; begin t0cki = 0; forever begin #(t0clkL) t0cki = ~t0cki; end end endtask
//-------------------------------- task drive_t1cki; begin t1cki = 0; forever begin #(t1clkH) t1cki = ~t1cki; end end endtask
//------------------------------ task drive_wdtclk; begin clkwdt = 0; forever begin #(wdtclkH) clkwdt = ~clkwdt; end end endtask
//------------------------------ task drive_extint; begin extint = 0; end endtask
//------------------------------ //task basic_drive_portain; //begin //forever begin assign porta = 8'h55; //repeat (64) @(posedge clk); //portai = 8'hAA; //repeat (64) @(posedge clk); //end //end //endtask /* //------------------------------ continue... Mong la de tai nay duoc cac ban quan tam