Random alloc fixed!
[vutg.git] / src / example4.vut
blob0fb0985cffcc77f193c058a27ea114258cc6033c
1 <?xml version="1.0" encoding="UTF-8"?>
2 <vut module_name="fulladder">
3 <time_scale t_div="10" unit="ns"/>
4 <waveform>
5 ============================================
6 a[7:0] i@|00|00|ff|ff|R1|R2|R4|R6|R2|ff|ff|
7 --------------------------------------------
8 b[7:0] i@|00|ff|00|ff|R3|R4|R1|R1|R5|ff|ff|ff|
9 ============================================
10 result[7:0]o@|00|ff|ff|fe|ref_function(a,b)|
11 --------------------------------------------
12 overflow o@|0 |0 |0 |1 |ref_function(a,b)|
13 ============================================
14 </waveform>
15 <gen_with>
16 R1 = (0,255)
17 R2 = (5,ff)
18 R3 = (30,ff)
19 R4 = (2f,ff)
20 R5 = (2,ff)
21 R6 = (0,6f)
23 <python_code output="result">lambda a,b: a + b</python_code>
25 <!--python_code output="overflow">include_python_file("overflow.py")</python_code-->
26 <python_code output="overflow">
27 lambda a,b: (a+b) > 255 and 1 or 0
28 #Eh o mesmo que if (a + b) > 255: return 1; else: return 0
29 #uma estencao seria res = python_code_file{dut.py}
30 </python_code>
31 </gen_with>
33 </vut>