Random alloc fixed!
[vutg.git] / src / teste.vut
blob3bf95ea3286fd126de8315b46bdc045ba07c6955
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|R1|R2|random_alloc([R1,R2],10)|R1|ff|ff|
7 --------------------------------------------
8 b[7:0] i@|00|FF|00|FF|R3|R4|R1|R1|R4|include_memory("teste.mem")|
9 ============================================
10 result[7:0]o@|00|FF|FF|00|ref_function(a,b,c)|
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,10A)
18 R3 = (30,150)
19 R4 = (2,6)
20 <python_code output="result">lambda a,b: a + b</python_code>
22 <!--python_code output="overflow">include_python_file("overflow.py")</python_code-->
23 <python_code output="overflow">
24 lambda a,b: (a+b) > 255 and 1 or 0
25 #Eh o mesmo que if (a + b) > 255: return 1; else: return 0
26 #uma estencao seria res = python_code_file{dut.py}
27 </python_code>
28 </gen_with>
29 </vut>