Line | |
---|
1 | #ifdef VHDL_TESTBENCH |
---|
2 | |
---|
3 | /* |
---|
4 | * $Id$ |
---|
5 | * |
---|
6 | * [ Description ] |
---|
7 | * |
---|
8 | */ |
---|
9 | |
---|
10 | #include "Behavioural/include/Vhdl_Testbench.h" |
---|
11 | |
---|
12 | namespace morpheo { |
---|
13 | namespace behavioural { |
---|
14 | |
---|
15 | void Vhdl_Testbench::generate_process_clock (uint32_t counter) |
---|
16 | { |
---|
17 | _vhdl->set_body(""); |
---|
18 | _vhdl->set_body(_clock_name+" <= not "+_clock_name+" after 50 ns;"); |
---|
19 | _vhdl->set_body("testbench_counter <= testbench_counter+1 after 100 ns;"); |
---|
20 | _vhdl->set_body(""); |
---|
21 | |
---|
22 | _vhdl->set_body("process ("+_clock_name+")"); |
---|
23 | _vhdl->set_body("begin"); |
---|
24 | _vhdl->set_body("\tif "+_clock_name+"'event and "+_clock_name+" = '1' then"); |
---|
25 | _vhdl->set_body(""); |
---|
26 | _vhdl->set_body("\t\tassert (not ((testbench_must_test = '1') and not (testbench_test = testbench_output)))"); |
---|
27 | _vhdl->set_body("\t\treport \" Test KO - output's test is different of output's component\""); |
---|
28 | _vhdl->set_body("\t\tseverity FAILURE;"); |
---|
29 | _vhdl->set_body(""); |
---|
30 | _vhdl->set_body("\t\tassert (not ((testbench_must_test = '1') and (testbench_test = testbench_output)))"); |
---|
31 | _vhdl->set_body("\t\treport \" Test OK\""); |
---|
32 | _vhdl->set_body("\t\tseverity NOTE;"); |
---|
33 | _vhdl->set_body(""); |
---|
34 | _vhdl->set_body("\t\tassert (not ( testbench_must_test = '0'))"); |
---|
35 | _vhdl->set_body("\t\treport \"No Test\""); |
---|
36 | _vhdl->set_body("\t\tseverity NOTE;"); |
---|
37 | _vhdl->set_body(""); |
---|
38 | _vhdl->set_body("\tend if;"); |
---|
39 | _vhdl->set_body("end process;"); |
---|
40 | |
---|
41 | _vhdl->set_body(""); |
---|
42 | _vhdl->set_body("assert (not (testbench_counter = " + toString(counter)+"))"); |
---|
43 | _vhdl->set_body("report \"End of Simulation\""); |
---|
44 | _vhdl->set_body("severity FAILURE;"); |
---|
45 | }; |
---|
46 | |
---|
47 | }; // end namespace behavioural |
---|
48 | }; // end namespace morpheo |
---|
49 | |
---|
50 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.