windowsでiverilog その127

#概要　

windowsでiverilogやってみた。
j1と言うcpuは、gforthのp-codeを実行するらしい、調べてみた。

#テストベンチ

```
module test;
	reg clk,
		rst;
	reg [15:0] io_din;
	wire io_rd;
	wire io_wr;
	wire [15:0] io_addr;
	wire [15:0] io_dout;
	j1 u(.clk(clk), .rst(rst), .io_din(io_din), .io_rd(io_rd), .io_wr(io_wr), .io_addr(io_addr), .io_dout(io_dout));
	initial
	begin
		clk = 0;
		rst = 0;
		#2
			rst = 1;
		#2
			rst = 0;
		#200
			$finish;
	end
	always
		#1
			clk = ~clk;
endmodule

```

#実行結果

```
WARNING: j2.v:40: $readmemh(./j1.hex): Not enough words in the file for the requested range [0:16383].
insn_addr= xxxx, insn = xxxx, sp=xx, rp=xx, S=xxxx xxxx
insn_addr= 0000, insn = xxxx, sp=00, rp=00, S=xxxx 0000
insn_addr= 0001, insn = 0010, sp=00, rp=00, S=xxxx xxxx
insn_addr= 0010, insn = 0000, sp=00, rp=00, S=xxxx xxxx
insn_addr= 0000, insn = 0cea, sp=00, rp=00, S=xxxx xxxx
insn_addr= 0cea, insn = 8002, sp=00, rp=00, S=xxxx xxxx
insn_addr= 0ceb, insn = be80, sp=01, rp=00, S=xxxx 0002
insn_addr= 0cec, insn = 8042, sp=02, rp=00, S=0002 3e80
insn_addr= 0ced, insn = 4566, sp=03, rp=00, S=3e80 0042
insn_addr= 0566, insn = 6147, sp=03, rp=01, S=3e80 0042
insn_addr= 0567, insn = 0570, sp=02, rp=02, S=0002 3e80
insn_addr= 0570, insn = 6b81, sp=02, rp=02, S=0002 3e80
insn_addr= 0571, insn = 2576, sp=03, rp=02, S=3e80 0042
insn_addr= 0572, insn = 6b8d, sp=02, rp=02, S=0002 3e80
insn_addr= 0573, insn = 6a00, sp=03, rp=01, S=3e80 0042
insn_addr= 0574, insn = 6147, sp=03, rp=01, S=3e80 0041
insn_addr= 0575, insn = 0568, sp=02, rp=02, S=0002 3e80
insn_addr= 0568, insn = 6147, sp=02, rp=02, S=0002 3e80
insn_addr= 0569, insn = 6081, sp=01, rp=03, S=xxxx 0002
insn_addr= 056a, insn = 4183, sp=02, rp=03, S=0002 0002
insn_addr= 0183, insn = 6081, sp=02, rp=04, S=0002 0002
insn_addr= 0184, insn = 6c00, sp=03, rp=04, S=0002 0002
insn_addr= 0185, insn = 6180, sp=03, rp=04, S=0002 zzzz
insn_addr= 0186, insn = 8001, sp=03, rp=04, S=zzzz 0002
insn_addr= 0187, insn = 6303, sp=04, rp=04, S=0002 0001
insn_addr= 0188, insn = 218c, sp=03, rp=04, S=zzzz 0000
insn_addr= 018c, insn = 80ff, sp=02, rp=04, S=0002 zzzz
insn_addr= 018d, insn = 730f, sp=03, rp=04, S=zzzz 00ff
insn_addr= 056b, insn = 6b81, sp=02, rp=03, S=0002 00xx
insn_addr= 056c, insn = 4192, sp=03, rp=03, S=00xx 3e80
insn_addr= 0192, insn = 6180, sp=03, rp=04, S=00xx 3e80
insn_addr= 0193, insn = 80ff, sp=03, rp=04, S=3e80 00xx
insn_addr= 0194, insn = 6303, sp=04, rp=04, S=00xx 00ff
insn_addr= 0195, insn = 6081, sp=03, rp=04, S=3e80 00xx
insn_addr= 0196, insn = 8008, sp=04, rp=04, S=00xx 00xx
insn_addr= 0197, insn = 6d03, sp=05, rp=04, S=00xx 0008
insn_addr= 0198, insn = 6403, sp=04, rp=04, S=00xx xx00
insn_addr= 0199, insn = 6180, sp=03, rp=04, S=3e80 xxxx
insn_addr= 019a, insn = 4153, sp=03, rp=04, S=xxxx 3e80
insn_addr= 0153, insn = 6180, sp=03, rp=05, S=xxxx 3e80
insn_addr= 0154, insn = 718d, sp=03, rp=05, S=3e80 xxxx
insn_addr= 019b, insn = 6081, sp=04, rp=04, S=xxxx 3e80
insn_addr= 019c, insn = 6c00, sp=05, rp=04, S=3e80 3e80
insn_addr= 019d, insn = 6180, sp=05, rp=04, S=3e80 zzzz
insn_addr= 019e, insn = 8001, sp=05, rp=04, S=zzzz 3e80
insn_addr= 019f, insn = 6303, sp=06, rp=04, S=3e80 0001
insn_addr= 01a0, insn = 8000, sp=05, rp=04, S=zzzz 0000
insn_addr= 01a1, insn = 6703, sp=06, rp=04, S=0000 0000
insn_addr= 01a2, insn = 80ff, sp=05, rp=04, S=zzzz ffff
insn_addr= 01a3, insn = 6503, sp=06, rp=04, S=ffff 00ff
insn_addr= 01a4, insn = 6147, sp=05, rp=04, S=zzzz ff00
insn_addr= 01a5, insn = 6181, sp=04, rp=05, S=xxxx zzzz
insn_addr= 01a6, insn = 6503, sp=05, rp=05, S=zzzz xxxx
insn_addr= 01a7, insn = 6b8d, sp=04, rp=05, S=xxxx xxxx
insn_addr= 01a8, insn = 6303, sp=05, rp=04, S=xxxx ff00
insn_addr= 01a9, insn = 6503, sp=04, rp=04, S=xxxx xx00
insn_addr= 01aa, insn = 6180, sp=03, rp=04, S=3e80 xxxx
insn_addr= 01ab, insn = 6023, sp=03, rp=04, S=xxxx 3e80
insn_addr= 01ac, insn = 710f, sp=02, rp=04, S=0002 3e80
insn_addr= 056d, insn = 416b, sp=01, rp=03, S=xxxx 0002
insn_addr= 016b, insn = 8001, sp=01, rp=04, S=xxxx 0002
insn_addr= 016c, insn = 720f, sp=02, rp=04, S=0002 0001
insn_addr= 056e, insn = 6b8d, sp=01, rp=03, S=xxxx 0003
insn_addr= 056f, insn = 416b, sp=02, rp=02, S=0003 3e80
insn_addr= 016b, insn = 8001, sp=02, rp=03, S=0003 3e80
insn_addr= 016c, insn = 720f, sp=03, rp=03, S=3e80 0001
insn_addr= 0570, insn = 6b81, sp=02, rp=02, S=0003 3e81
insn_addr= 0571, insn = 2576, sp=03, rp=02, S=3e81 0041
insn_addr= 0572, insn = 6b8d, sp=02, rp=02, S=0003 3e81
insn_addr= 0573, insn = 6a00, sp=03, rp=01, S=3e81 0041
insn_addr= 0574, insn = 6147, sp=03, rp=01, S=3e81 0040
insn_addr= 0575, insn = 0568, sp=02, rp=02, S=0003 3e81
insn_addr= 0568, insn = 6147, sp=02, rp=02, S=0003 3e81
insn_addr= 0569, insn = 6081, sp=01, rp=03, S=xxxx 0003
insn_addr= 056a, insn = 4183, sp=02, rp=03, S=0003 0003
insn_addr= 0183, insn = 6081, sp=02, rp=04, S=0003 0003
insn_addr= 0184, insn = 6c00, sp=03, rp=04, S=0003 0003
insn_addr= 0185, insn = 6180, sp=03, rp=04, S=0003 zzzz
insn_addr= 0186, insn = 8001, sp=03, rp=04, S=zzzz 0003
insn_addr= 0187, insn = 6303, sp=04, rp=04, S=0003 0001
insn_addr= 0188, insn = 218c, sp=03, rp=04, S=zzzz 0001
insn_addr= 0189, insn = 8008, sp=02, rp=04, S=0003 zzzz
insn_addr= 018a, insn = 6903, sp=03, rp=04, S=zzzz 0008
insn_addr= 018b, insn = 018e, sp=02, rp=04, S=0003 00zz
insn_addr= 018e, insn = 700c, sp=02, rp=04, S=0003 00zz
insn_addr= 056b, insn = 6b81, sp=02, rp=03, S=0003 00zz
insn_addr= 056c, insn = 4192, sp=03, rp=03, S=00zz 3e81
insn_addr= 0192, insn = 6180, sp=03, rp=04, S=00zz 3e81
insn_addr= 0193, insn = 80ff, sp=03, rp=04, S=3e81 00zz
insn_addr= 0194, insn = 6303, sp=04, rp=04, S=00zz 00ff
insn_addr= 0195, insn = 6081, sp=03, rp=04, S=3e81 00xx
insn_addr= 0196, insn = 8008, sp=04, rp=04, S=00xx 00xx
insn_addr= 0197, insn = 6d03, sp=05, rp=04, S=00xx 0008
insn_addr= 0198, insn = 6403, sp=04, rp=04, S=00xx xx00
insn_addr= 0199, insn = 6180, sp=03, rp=04, S=3e81 xxxx
insn_addr= 019a, insn = 4153, sp=03, rp=04, S=xxxx 3e81
insn_addr= 0153, insn = 6180, sp=03, rp=05, S=xxxx 3e81
insn_addr= 0154, insn = 718d, sp=03, rp=05, S=3e81 xxxx
insn_addr= 019b, insn = 6081, sp=04, rp=04, S=xxxx 3e81
insn_addr= 019c, insn = 6c00, sp=05, rp=04, S=3e81 3e81
insn_addr= 019d, insn = 6180, sp=05, rp=04, S=3e81 zzzz
insn_addr= 019e, insn = 8001, sp=05, rp=04, S=zzzz 3e81

```

以上。