-
Notifications
You must be signed in to change notification settings - Fork 0
/
uart_tb
executable file
·252 lines (252 loc) · 7.34 KB
/
uart_tb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
#! /Users/mohamed/workspace/tools/oss-cad-suite/bin/vvp
:ivl_version "13.0 (devel)" "(s20221226-518-g94d9d1951)";
:ivl_delay_selection "TYPICAL";
:vpi_time_precision - 12;
:vpi_module "/Users/mohamed/workspace/tools/oss-cad-suite/lib/ivl/system.vpi";
:vpi_module "/Users/mohamed/workspace/tools/oss-cad-suite/lib/ivl/vhdl_sys.vpi";
:vpi_module "/Users/mohamed/workspace/tools/oss-cad-suite/lib/ivl/vhdl_textio.vpi";
:vpi_module "/Users/mohamed/workspace/tools/oss-cad-suite/lib/ivl/v2005_math.vpi";
:vpi_module "/Users/mohamed/workspace/tools/oss-cad-suite/lib/ivl/va_math.vpi";
S_0x14170c130 .scope module, "uart_tb" "uart_tb" 2 5;
.timescale -9 -12;
v0x141727fa0_0 .var "btn", 0 0;
v0x141728030_0 .var "clk", 0 0;
v0x1417280c0_0 .net "led", 5 0, v0x141727c20_0; 1 drivers
v0x141728190_0 .var "uart_rx", 0 0;
o0x1380301c0 .functor BUFZ 1, c4<z>; HiZ drive
v0x141728240_0 .net "uart_tx", 0 0, o0x1380301c0; 0 drivers
S_0x141704c50 .scope module, "uut0" "uart" 2 14, 3 1 0, S_0x14170c130;
.timescale -9 -12;
.port_info 0 /INPUT 1 "clk";
.port_info 1 /INPUT 1 "uart_rx";
.port_info 2 /INPUT 1 "btn";
.port_info 3 /OUTPUT 1 "uart_tx";
.port_info 4 /OUTPUT 6 "led";
P_0x141718140 .param/l "DATA_WIDTH" 1 3 16, +C4<00000000000000000000000000001000>;
P_0x141718180 .param/l "HALF_WAIT_CYCLES" 1 3 15, +C4<00000000000000000000000000000100>;
P_0x1417181c0 .param/l "RX_STATE_IDLE" 1 3 9, +C4<00000000000000000000000000000000>;
P_0x141718200 .param/l "RX_STATE_READ" 1 3 12, +C4<00000000000000000000000000000011>;
P_0x141718240 .param/l "RX_STATE_START" 1 3 10, +C4<00000000000000000000000000000001>;
P_0x141718280 .param/l "RX_STATE_STOP" 1 3 13, +C4<00000000000000000000000000000100>;
P_0x1417182c0 .param/l "RX_STATE_WAIT" 1 3 11, +C4<00000000000000000000000000000010>;
P_0x141718300 .param/l "WAIT_CYCLES" 0 3 2, +C4<00000000000000000000000000001000>;
v0x14170c2a0_0 .net "btn", 0 0, v0x141727fa0_0; 1 drivers
v0x141727900_0 .var "byte_is_ready", 0 0;
v0x1417279a0_0 .net "clk", 0 0, v0x141728030_0; 1 drivers
v0x141727a30_0 .var "counter", 7 0;
v0x141727ac0_0 .var "data", 7 0;
v0x141727b70_0 .var "how_many_bits_are_ready", 2 0;
v0x141727c20_0 .var "led", 5 0;
v0x141727cd0_0 .var "state", 2 0;
v0x141727d80_0 .net "uart_rx", 0 0, v0x141728190_0; 1 drivers
v0x141727e90_0 .net "uart_tx", 0 0, o0x1380301c0; alias, 0 drivers
E_0x141706da0 .event posedge, v0x1417279a0_0;
.scope S_0x141704c50;
T_0 ;
%wait E_0x141706da0;
%load/vec4 v0x141727cd0_0;
%dup/vec4;
%pushi/vec4 0, 0, 3;
%cmp/u;
%jmp/1 T_0.0, 6;
%dup/vec4;
%pushi/vec4 1, 0, 3;
%cmp/u;
%jmp/1 T_0.1, 6;
%dup/vec4;
%pushi/vec4 2, 0, 3;
%cmp/u;
%jmp/1 T_0.2, 6;
%dup/vec4;
%pushi/vec4 3, 0, 3;
%cmp/u;
%jmp/1 T_0.3, 6;
%dup/vec4;
%pushi/vec4 4, 0, 3;
%cmp/u;
%jmp/1 T_0.4, 6;
%pushi/vec4 0, 0, 3;
%assign/vec4 v0x141727cd0_0, 0;
%jmp T_0.6;
T_0.0 ;
%load/vec4 v0x141727d80_0;
%cmpi/e 0, 0, 1;
%jmp/0xz T_0.7, 4;
%pushi/vec4 1, 0, 8;
%assign/vec4 v0x141727a30_0, 0;
%pushi/vec4 0, 0, 1;
%assign/vec4 v0x141727900_0, 0;
%pushi/vec4 0, 0, 3;
%assign/vec4 v0x141727b70_0, 0;
%pushi/vec4 1, 0, 3;
%assign/vec4 v0x141727cd0_0, 0;
T_0.7 ;
%jmp T_0.6;
T_0.1 ;
%load/vec4 v0x141727a30_0;
%addi 1, 0, 8;
%assign/vec4 v0x141727a30_0, 0;
%load/vec4 v0x141727a30_0;
%pad/u 32;
%cmpi/e 4, 0, 32;
%jmp/0xz T_0.9, 4;
%pushi/vec4 0, 0, 8;
%assign/vec4 v0x141727a30_0, 0;
%pushi/vec4 2, 0, 3;
%assign/vec4 v0x141727cd0_0, 0;
T_0.9 ;
%jmp T_0.6;
T_0.2 ;
%load/vec4 v0x141727a30_0;
%addi 1, 0, 8;
%assign/vec4 v0x141727a30_0, 0;
%load/vec4 v0x141727a30_0;
%pad/u 32;
%cmpi/e 7, 0, 32;
%jmp/0xz T_0.11, 4;
%pushi/vec4 3, 0, 3;
%store/vec4 v0x141727cd0_0, 0, 3;
T_0.11 ;
%jmp T_0.6;
T_0.3 ;
%load/vec4 v0x141727b70_0;
%addi 1, 0, 3;
%assign/vec4 v0x141727b70_0, 0;
%load/vec4 v0x141727d80_0;
%load/vec4 v0x141727ac0_0;
%parti/s 7, 1, 2;
%concat/vec4; draw_concat_vec4
%assign/vec4 v0x141727ac0_0, 0;
%pushi/vec4 1, 0, 8;
%assign/vec4 v0x141727a30_0, 0;
%load/vec4 v0x141727b70_0;
%pad/u 32;
%cmpi/e 7, 0, 32;
%jmp/0xz T_0.13, 4;
%pushi/vec4 4, 0, 3;
%assign/vec4 v0x141727cd0_0, 0;
%pushi/vec4 1, 0, 8;
%assign/vec4 v0x141727a30_0, 0;
%jmp T_0.14;
T_0.13 ;
%pushi/vec4 2, 0, 3;
%assign/vec4 v0x141727cd0_0, 0;
T_0.14 ;
%jmp T_0.6;
T_0.4 ;
%load/vec4 v0x141727a30_0;
%addi 1, 0, 8;
%assign/vec4 v0x141727a30_0, 0;
%load/vec4 v0x141727a30_0;
%pad/u 32;
%cmpi/e 8, 0, 32;
%jmp/0xz T_0.15, 4;
%pushi/vec4 0, 0, 3;
%assign/vec4 v0x141727cd0_0, 0;
%pushi/vec4 1, 0, 1;
%assign/vec4 v0x141727900_0, 0;
T_0.15 ;
%jmp T_0.6;
T_0.6 ;
%pop/vec4 1;
%jmp T_0;
.thread T_0;
.scope S_0x141704c50;
T_1 ;
%wait E_0x141706da0;
%load/vec4 v0x141727900_0;
%flag_set/vec4 8;
%jmp/0xz T_1.0, 8;
%load/vec4 v0x141727ac0_0;
%parti/s 6, 0, 2;
%inv;
%assign/vec4 v0x141727c20_0, 0;
T_1.0 ;
%jmp T_1;
.thread T_1;
.scope S_0x14170c130;
T_2 ;
%delay 1000, 0;
%load/vec4 v0x141728030_0;
%inv;
%store/vec4 v0x141728030_0, 0, 1;
%jmp T_2;
.thread T_2;
.scope S_0x14170c130;
T_3 ;
%pushi/vec4 1, 0, 1;
%store/vec4 v0x141728030_0, 0, 1;
%vpi_call 2 25 "$dumpfile", "uart_tb.vcd" {0 0 0};
%vpi_call 2 26 "$dumpvars" {0 0 0};
%pushi/vec4 1, 0, 1;
%store/vec4 v0x141728190_0, 0, 1;
%delay 6000, 0;
%pushi/vec4 0, 0, 1;
%store/vec4 v0x141728190_0, 0, 1;
%delay 16000, 0;
%pushi/vec4 1, 0, 1;
%store/vec4 v0x141728190_0, 0, 1;
%delay 16000, 0;
%pushi/vec4 0, 0, 1;
%store/vec4 v0x141728190_0, 0, 1;
%delay 16000, 0;
%pushi/vec4 1, 0, 1;
%store/vec4 v0x141728190_0, 0, 1;
%delay 16000, 0;
%pushi/vec4 1, 0, 1;
%store/vec4 v0x141728190_0, 0, 1;
%delay 16000, 0;
%pushi/vec4 0, 0, 1;
%store/vec4 v0x141728190_0, 0, 1;
%delay 16000, 0;
%pushi/vec4 0, 0, 1;
%store/vec4 v0x141728190_0, 0, 1;
%delay 16000, 0;
%pushi/vec4 1, 0, 1;
%store/vec4 v0x141728190_0, 0, 1;
%delay 16000, 0;
%pushi/vec4 0, 0, 1;
%store/vec4 v0x141728190_0, 0, 1;
%delay 16000, 0;
%pushi/vec4 1, 0, 1;
%store/vec4 v0x141728190_0, 0, 1;
%delay 16000, 0;
%pushi/vec4 0, 0, 1;
%store/vec4 v0x141728190_0, 0, 1;
%delay 16000, 0;
%pushi/vec4 0, 0, 1;
%store/vec4 v0x141728190_0, 0, 1;
%delay 16000, 0;
%pushi/vec4 1, 0, 1;
%store/vec4 v0x141728190_0, 0, 1;
%delay 16000, 0;
%pushi/vec4 1, 0, 1;
%store/vec4 v0x141728190_0, 0, 1;
%delay 16000, 0;
%pushi/vec4 0, 0, 1;
%store/vec4 v0x141728190_0, 0, 1;
%delay 16000, 0;
%pushi/vec4 1, 0, 1;
%store/vec4 v0x141728190_0, 0, 1;
%delay 16000, 0;
%pushi/vec4 0, 0, 1;
%store/vec4 v0x141728190_0, 0, 1;
%delay 16000, 0;
%pushi/vec4 1, 0, 1;
%store/vec4 v0x141728190_0, 0, 1;
%delay 16000, 0;
%pushi/vec4 1, 0, 1;
%store/vec4 v0x141728190_0, 0, 1;
%delay 16000, 0;
%pushi/vec4 1, 0, 1;
%store/vec4 v0x141728190_0, 0, 1;
%delay 100000, 0;
%vpi_call 2 73 "$finish" {0 0 0};
%end;
.thread T_3;
# The file index is used to find the file name in the following table.
:file_names 4;
"N/A";
"<interactive>";
"uart_tb.v";
"./uart.v";