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?

More than 1 year has passed since last update.

高位合成言語 NSL

Last updated at Posted at 2020-07-04

概要

windowsでiverilogやってみた。
nslやってみた。

サンプルコード

declare test_finish {
}
module test_finish {
	reg trigger[3] = 0;
	reg cnt[4] = 0;
	func_self exec_add();
	trigger := { trigger[1:0], 0b1 };
	if (trigger == 3'b011) exec_add();
	func exec_add seq {
		for (cnt := 0; cnt < 10; cnt++) {
			_display("%d", cnt);
		}
		_finish("neko");
	}
}

テストベンチ

module test;
	reg clk,
		rst;
	test_finish u(.clk(clk), .rst(rst));
	always #1 clk = ~clk;
	initial
	begin
		clk = 0;
		rst = 1;
		#1
			rst = 0;
		#1
			rst = 1;
		#100
			$finish;
	end
endmodule

実行結果



Warning: register set hazard(test_finish:cnt) at                    1
 0
 1
 2
 3
 4
 5
 6
 7
 8
 9
neko

以上。

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?