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 その204

Posted at

概要 

windowsでiverilogやってみた。
pwm見つけたので、テストベンチ書いてみた。

参考にしたページ

写真

image.png

サンプルコード

module test;
	reg clk;
	reg increase_duty;
	reg decrease_duty;
	wire PWM_OUT;
	PWM_Generator_Verilog u(.clk(clk), .increase_duty(increase_duty), .decrease_duty(decrease_duty), .PWM_OUT(PWM_OUT));
	initial
	begin
		clk = 0;
		forever #5 clk = ~clk;
	end
	initial
	begin
		//$monitor(" %d %d %d", increase_duty, decrease_duty, PWM_OUT);
		increase_duty = 0;
		decrease_duty = 0;
		#100;
			increase_duty = 1;
		#100;
			increase_duty = 0;
		#100;
			increase_duty = 1;
		#100;
			increase_duty = 0;
		#100;
			increase_duty = 1;
		#100;
			increase_duty = 0;
		#100;
			decrease_duty = 1;
		#100;
			decrease_duty = 0;
		#100;
			decrease_duty = 1;
		#100;
			decrease_duty = 0;
		#100;
			decrease_duty = 0;
		#100
			$finish;
	end
	initial
	begin
		$dumpfile("test.vcd");
		$dumpvars(0, u);
	end
endmodule





以上

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?