0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

windowsでiverilog その170

Last updated at Posted at 2024-12-21

概要 

windowsでiverilogやってみた。
自作cpu、見つけたので、調査してみた。
テストベンチやってみた。

参考にしたページ

サンプルコード

module test;
	reg clk;
	reg reset;
	wire [3:0] acc;
	wire [3:0] mem_out;
	SimpleCPU u(.clk(clk), .reset(reset), .acc(acc), .mem_out(mem_out));
	initial
	begin
		clk = 0;
		forever #5 clk = ~clk;
	end
	initial
	begin
		reset = 1;
	#10
		reset = 0;
	#100
		$finish;
	end
	initial
	begin
		$display("Time            ACC  MEM[0]");
		$monitor(" %d %b %b", $time, acc, mem_out);
	end
endmodule

実行結果

>vvp a.out
Time            ACC  MEM[0]
                    0 0000 0101
                   15 0101 0101
                   25 1000 0101
                   35 1000 1000
sc0.v:70: $finish called at 110 (1s)

以上。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?