`define HMAX 100 // H total dots `define HSIZ 80 // H Size `define HSP 84 // H Sync. Pos. `define HSL 12 // H Sync. Len. `define HCR 8 // H dots per Char. `define VMAX 28 // V total Line `define VSIZ 25 // V Size `define VSP 26 // V Sync. Pos. `define VSL 1 // V Sync. Line `define VCR 19 // V lines per Char. module vram_t (CLK, RST, R, G, B, HS, VS); input CLK, RST; output R, G, B, HS, VS; reg [ 6:0] VRAM[0:2047]; reg [ 7:0] CGROM[0:2047]; initial begin $readmemh( "VRAM初期化.ram", VRAM ); $readmemh( "キャラクタデータ.ram", CGROM ); end reg [6:0] HCNT; // H Counter 0-99 ...
initial begin $shm_open("waves.shm"); $shm_probe("as"); endを書いておくことで、下位階層すべての信号変化をシミュレータで観測できます。
`timescale 1ns/1ns module vram_t_test; reg CLK, RST; wire R, G, B, HS, VS; initial begin $shm_open("waves.shm"); $shm_probe("as"); end integer i; initial begin CLK = 0; for( i=0 ; i<1000000 ; i=i+1 ) CLK = #10 ~CLK; end initial begin RST = 0; RST = #5 1; RST = #10 0; end vram_t v1 (CLK, RST, R, G, B, HS, VS); endmodule