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 5 years have passed since last update.

高位合成言語 synthesijer その2

Posted at

概要

vistaでsynthesijerやってみた。
helloworldやってみた。

ソース


import synthesijer.rt.*;

public class Hello {
	public byte v = 12;
	//private byte[] a = new byte[]{'h', 'e', 'l', 'l', 'o', ' ', 'w', 'o', 'r', 'l', 'd', '!'};
	@auto public void run() {
		byte i;
		for (i = 0; i < 12; i++)
		{
			//v = i;
			switch(i)
			{
			case 0:
				v = 'h';
			break;
			case 1:
				v = 'e';
			break;
			case 2:
				v = 'l';
			break;
			case 3:
				v = 'l';
			break;
			case 4:
				v = 'o';
			break;
			case 5:
				v = ' ';
			break;
			case 6:
				v = 'w';
			break;
			case 7:
				v = 'o';
			break;
			case 8:
				v = 'r';
			break;
			case 9:
				v = 'l';
			break;
			case 10:
				v = 'd';
			break;
			case 11:
				v = '!';
			break;
			default:
				v = ' ';
			break;
			}
		}
	}
}




テストベンチ


module test();
	reg clk = 0;
	reg rst = 1;
	reg v_in = 0;
	reg v_we = 0;
	wire [7:0] v_out;
	Hello u(.clk(clk), .reset(rst), .v_in(v_in), .v_we(v_we), .v_out(v_out));
	initial
	begin
		$monitor("%s", v_out);
		#10
			rst = 1;
		#10
			rst = 0;
		#300
			$finish;
	end
	always
	begin
		#1
			clk = ~clk;
	end
	initial
	begin
		$dumpfile("test.vcd");
		$dumpvars(0, test);
	end
endmodule





iverilog実行結果


VCD info: dumpfile test.vcd opened for output.

h
e
l
o

w
o
r
l
d
!
h


以上。

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?