├── Additional_Reading.md ├── DATE_2024.md ├── ESWEEK_2024.md ├── README.md ├── TSS_2024.md ├── demo_files └── AutoChip │ ├── DATE │ ├── 7420_0_tb.v │ ├── Adder3_0_tb.v │ └── Rule90_0_tb.v │ ├── ESWEEK │ ├── 7420_example │ │ ├── 7420.sv │ │ ├── 7420_tb.sv │ │ └── config.json │ ├── arbiter_example │ │ ├── 2013_q2afsm.sv │ │ ├── 2013_q2afsm_tb.sv │ │ └── config.json │ └── rule90_example │ │ ├── config.json │ │ ├── rule90.sv │ │ └── rule90_tb.sv │ ├── ETS │ ├── 7420_example │ │ ├── 7420.sv │ │ ├── 7420_tb.sv │ │ └── config.json │ ├── arbiter_example │ │ ├── 2013_q2afsm.sv │ │ ├── 2013_q2afsm_tb.sv │ │ └── config.json │ └── rule90_example │ │ ├── config.json │ │ ├── rule90.sv │ │ └── rule90_tb.sv │ └── TSS │ ├── 7420_0_tb.v │ ├── Adder3_0_tb.v │ └── Rule90_0_tb.v ├── pictures ├── DATE_2024_1.png └── DATE_2024_2.png └── presentations └── HLSforSecurity-TSS-ETS-May-2024.pdf /Additional_Reading.md: -------------------------------------------------------------------------------- 1 | ### Generating Verilog 2 | #### DAVE (Deriving Automatically Verilog from English) 3 | - Paper: https://arxiv.org/abs/2009.01026 4 | #### LLMs for Automated Verilog Generation (VeriGen) 5 | - Paper: https://arxiv.org/abs/2212.11140 6 | - Repo: https://github.com/shailja-thakur/VGen 7 | #### ChipChat 8 | - Paper: https://arxiv.org/abs/2305.13243 9 | #### AutoChip 10 | - Paper: https://arxiv.org/abs/2311.04887 11 | - Repo: https://github.com/shailja-thakur/AutoChip 12 | #### Optimized RTL Code Generation Using MCTS 13 | - Paper: https://arxiv.org/abs/2402.03289 14 | ### Security Analysis of LLM Generated Code 15 | #### Asleep at the Keyboard 16 | - Paper: https://arxiv.org/abs/2108.09293 17 | ### LLMs for Bug Detection & Repair 18 | #### Zero-shot Vulnerability Repair 19 | - Paper: https://arxiv.org/abs/2112.02125 20 | #### Fixing Hardware Bugs 21 | - Paper: https://arxiv.org/abs/2302.01215 22 | #### Hardware Assertions 23 | - Paper: https://arxiv.org/abs/2306.14027 24 | #### Security Bug Finding 25 | - Paper: https://arxiv.org/abs/2306.12643 26 | ### LLM Metric Frameworks 27 | #### CreativEval: Evaluating Creativity of LLM-Based Hardware Code Generation 28 | - Paper: https://arxiv.org/abs/2404.08806 29 | -------------------------------------------------------------------------------- /DATE_2024.md: -------------------------------------------------------------------------------- 1 | # LLMs for EDA Tutorial Resources 2 | 3 | ## 📅 26 March, 2024 - 16:30: Room S1+2 4 | For the DATE 2024 tutorial: [Using Generative AI for Next-generation EDA](https://www.date-conference.com/embedded-tutorial/et01) 5 | 6 | Here we provide resources from the tutorial itself, as well as additional resources related to the topics discussed. 7 | 8 | ## Generating HDL with Feedback Loops 9 | ### Slides 10 | https://docs.google.com/presentation/d/11LRoS_cXT9edCsGC3phwMg8PaxwQasIfkjv0TKSbjOY/edit?usp=sharing 11 | 12 | ### Colab Notebook 13 | https://colab.research.google.com/drive/1Va3Jp5zwr4RW-zrCHIHQvJ8pmhN-EFpD?usp=sharing 14 | 15 | ## VeriGen 16 | 17 | ### Slides 18 | https://docs.google.com/presentation/d/1YkYKaaPcDMpd8W5t-eU0Ay_4NxClxU_J5_VSo-iDZ10/edit?usp=sharing 19 | 20 | ### Colab Notebook 21 | https://colab.research.google.com/drive/1ej8KTGtwqz3k4ZKDTeprmhELZinbEIdQ?usp=sharing 22 | 23 | ## LLM for Bug Detection 24 | 25 | ### Slides 26 | https://tamucs-my.sharepoint.com/:p:/g/personal/gohil_vasudev_tamu_edu/EZLbyLfKxoZGk7YHE5QNPrUB_TlHbohVJ_FvL_GI__oLmw?e=Rpv4Wz 27 | 28 | ### Colab Notebook 29 | https://colab.research.google.com/drive/1NJKfDE5GxWru92vUK4k-kVncMK3Znufx?usp=sharing 30 | 31 | ## Event Pictures 32 | ![DATE Picture 1](./pictures/DATE_2024_1.png) 33 | ![DATE Picture 2](./pictures/DATE_2024_2.png) 34 | -------------------------------------------------------------------------------- /ESWEEK_2024.md: -------------------------------------------------------------------------------- 1 | # LLMs for EDA Tutorial Resources - ESWEEK 2 | 3 | ## 📅 29 September, 2024: 13:30 - 17:00 4 | ### Title: Generative AI for Next-Generation EDA Tool-flows 5 | Here we provide resources from the tutorial itself, as well as additional resources related to the topics discussed. 6 | 7 | ## Automating HDL Generation with Feedback 8 | ### [Slides](https://docs.google.com/presentation/d/1XAnNGGQOPqK3F55zV5yqICy9Hiz-S2eCclCLgaAe1H8/edit?usp=sharing) 9 | 10 | ### [Colab Notebook](https://colab.research.google.com/drive/1vaJXgKArX4ZkfexdWRBGRZGNtqiBFwJJ?usp=drive_link) 11 | 12 | ## LLMs for Security Assertion Generation 13 | ### [Slides](https://tamucs-my.sharepoint.com/:p:/g/personal/matthewdelorenzo_tamu_edu/EfqK9SwXn2ZCoLVMgizf5w0Bd5QH_ptqge_jiKfIaWI8sg?e=QcG4Bi) 14 | ### [Colab Notebook](https://colab.research.google.com/drive/1OG5nmWKTvbsvfmMrlIy3L-0U1wzWOtkS?usp=sharing) 15 | 16 | ## LLMs for Plagiarizing Designs 17 | ### [Slides](https://tamucs-my.sharepoint.com/:p:/g/personal/matthewdelorenzo_tamu_edu/EfmzMhJpxe9Lr66GT7lUpi0BmibQMx8M-5M7vq3BiSA5Ag?e=FpDSke) 18 | ### [Video](https://youtu.be/j2uD0K0V2lU) 19 | ### [Colab Notebook](https://colab.research.google.com/drive/1V-i_pCV9cRihFHWmugsHGsdlbcYKmgSG?usp=sharing) 20 | 21 | ## Cybersecurity for LLM Generated Hardware 22 | ### [Slides](./presentations/HLSforSecurity-TSS-ETS-May-2024.pdf) 23 | 24 | ## [Additional Reading](./Additional_Reading.md) 25 | 26 | ## Previous Editions 27 | [DATE 2024](./DATE_2024.md) 28 | [TSS 2024](./TSS_2024.md) 29 | 30 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # LLMs for EDA Tutorial Resources - ETS 2 | 3 | ## 📅 29 May, 2025: 12:00 - 12:30 4 | ### Title: Generative AI for Next-Generation EDA Tool-flows 5 | Here we provide resources from the tutorial itself, as well as additional resources related to the topics discussed. 6 | 7 | ## Automating HDL Generation with Feedback 8 | ### [Slides](https://docs.google.com/presentation/d/1_KJpriOJrvwpnHpMITuiJwAn-vlXv9lG3SL9Mevi97E/edit?usp=sharing) 9 | 10 | ### [Colab Notebook](https://colab.research.google.com/drive/1lGHeeYxDo1exTJ334-XN0oiwg7ZP9ewa?usp=sharing) 11 | 12 | ## [Additional Reading](./Additional_Reading.md) 13 | 14 | ## Previous Editions 15 | [DATE 2024](./DATE_2024.md) 16 | [TSS 2024](./TSS_2024.md) 17 | [ETS 2024](./ETS_2024.md) 18 | -------------------------------------------------------------------------------- /TSS_2024.md: -------------------------------------------------------------------------------- 1 | # LLMs for EDA Tutorial Resources - Test Spring School 2 | 3 | ## 📅 20 May, 2024: 14:00 - 18:30, Break from 16:00 - 16:30 4 | ### Title: Security of Generative AI and Generative AI for Security 5 | Here we provide resources from the tutorial itself, as well as additional resources related to the topics discussed. 6 | 7 | ## Generating HDL with Feedback Loops 8 | ### [Slides](https://docs.google.com/presentation/d/12XUBltMFyWy6pKT7H3qHiMxyo2AkleDOV8IGHdYT_bs/edit?usp=sharing) 9 | 10 | ### [Colab Notebook](https://colab.research.google.com/drive/1dOf4jk9bw6djduo6VWqBNletUcAxIFFz?usp=sharing) 11 | 12 | ## LLMs for Security Assertion Generation 13 | ### [Slides](https://tamucs-my.sharepoint.com/:p:/g/personal/gohil_vasudev_tamu_edu/EZLbyLfKxoZGk7YHE5QNPrUB_TlHbohVJ_FvL_GI__oLmw?e=Rpv4Wz) 14 | 15 | ### [Colab Notebook](https://colab.research.google.com/drive/1NJKfDE5GxWru92vUK4k-kVncMK3Znufx?usp=sharing) 16 | 17 | ## LLMs for Plagiarizing Designs 18 | ### [Slides](https://tamucs-my.sharepoint.com/:p:/g/personal/gohil_vasudev_tamu_edu/ERe3E4pNZhdNqAaGqhNFlKoBDhUpL845YyaAnqfLOeS6UA?e=WmWhpb) 19 | ### [Video](https://youtu.be/j2uD0K0V2lU) 20 | ### [Colab Notebook](https://colab.research.google.com/drive/1_i6SGbxUX2gCB3KiRV5x-XKUExq020eP?usp=sharing) 21 | 22 | ## Cybersecurity for LLM Generated Hardware 23 | ### [Slides](./presentations/HLSforSecurity-TSS-ETS-May-2024.pdf) 24 | 25 | ## [Additional Reading](./Additional_Reading.md) 26 | -------------------------------------------------------------------------------- /demo_files/AutoChip/DATE/7420_0_tb.v: -------------------------------------------------------------------------------- 1 | `timescale 1 ns/10 ps // time-unit = 1 ns, precision = 10 ps 2 | 3 | module top_module_tb; 4 | 5 | // duration for each bit = 20 * timescale = 20 * 1 ns = 20ns 6 | localparam period = 20; 7 | 8 | reg p1a; 9 | reg p1b; 10 | reg p1c; 11 | reg p1d; 12 | reg p2a; 13 | reg p2b; 14 | reg p2c; 15 | reg p2d; 16 | 17 | wire p1y; 18 | wire p2y; 19 | 20 | 21 | integer mismatch_count; 22 | 23 | top_module UUT (.p1a(p1a), .p1b(p1b), .p1c(p1c), .p1d(p1d), .p2a(p2a), .p2b(p2b), .p2c(p2c), .p2d(p2d), .p1y(p1y), .p2y(p2y)); 24 | 25 | initial begin 26 | mismatch_count = 0; 27 | 28 | // Tick 0: Inputs = 1'b0, 1'b0, 1'b0, 1'b0, 1'b0, 1'b0, 1'b0, 1'b0, Generated = p1y, p2y, Reference = 1'b1, 1'b1 29 | p1a = 1'b0; p1b = 1'b0; p1c = 1'b0; p1d = 1'b0; p2a = 1'b0; p2b = 1'b0; p2c = 1'b0; p2d = 1'b0; // Set input values 30 | #period; 31 | if (!(p1y === 1'b1 && p2y === 1'b1)) begin 32 | $display("Mismatch at index 0: Inputs = [%b, %b, %b, %b, %b, %b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 1'b0, 1'b0, 1'b0, 1'b0, 1'b0, 1'b0, 1'b0, 1'b0, p1y, p2y, 1'b1, 1'b1); 33 | mismatch_count = mismatch_count + 1; 34 | end 35 | 36 | else begin 37 | $display("Test 0 passed!"); 38 | end 39 | 40 | // Tick 1: Inputs = 1'b0, 1'b0, 1'b0, 1'b0, 1'b0, 1'b0, 1'b0, 1'b1, Generated = p1y, p2y, Reference = 1'b1, 1'b1 41 | p1a = 1'b0; p1b = 1'b0; p1c = 1'b0; p1d = 1'b0; p2a = 1'b0; p2b = 1'b0; p2c = 1'b0; p2d = 1'b1; // Set input values 42 | #period; 43 | if (!(p1y === 1'b1 && p2y === 1'b1)) begin 44 | $display("Mismatch at index 1: Inputs = [%b, %b, %b, %b, %b, %b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 1'b0, 1'b0, 1'b0, 1'b0, 1'b0, 1'b0, 1'b0, 1'b1, p1y, p2y, 1'b1, 1'b1); 45 | mismatch_count = mismatch_count + 1; 46 | end 47 | 48 | else begin 49 | $display("Test 1 passed!"); 50 | end 51 | 52 | // Tick 2: Inputs = 1'b0, 1'b0, 1'b0, 1'b0, 1'b0, 1'b0, 1'b0, 1'b1, Generated = p1y, p2y, Reference = 1'b1, 1'b1 53 | p1a = 1'b0; p1b = 1'b0; p1c = 1'b0; p1d = 1'b0; p2a = 1'b0; p2b = 1'b0; p2c = 1'b0; p2d = 1'b1; // Set input values 54 | #period; 55 | if (!(p1y === 1'b1 && p2y === 1'b1)) begin 56 | $display("Mismatch at index 2: Inputs = [%b, %b, %b, %b, %b, %b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 1'b0, 1'b0, 1'b0, 1'b0, 1'b0, 1'b0, 1'b0, 1'b1, p1y, p2y, 1'b1, 1'b1); 57 | mismatch_count = mismatch_count + 1; 58 | end 59 | 60 | else begin 61 | $display("Test 2 passed!"); 62 | end 63 | 64 | // Tick 3: Inputs = 1'b0, 1'b0, 1'b0, 1'b1, 1'b0, 1'b0, 1'b1, 1'b0, Generated = p1y, p2y, Reference = 1'b1, 1'b1 65 | p1a = 1'b0; p1b = 1'b0; p1c = 1'b0; p1d = 1'b1; p2a = 1'b0; p2b = 1'b0; p2c = 1'b1; p2d = 1'b0; // Set input values 66 | #period; 67 | if (!(p1y === 1'b1 && p2y === 1'b1)) begin 68 | $display("Mismatch at index 3: Inputs = [%b, %b, %b, %b, %b, %b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 1'b0, 1'b0, 1'b0, 1'b1, 1'b0, 1'b0, 1'b1, 1'b0, p1y, p2y, 1'b1, 1'b1); 69 | mismatch_count = mismatch_count + 1; 70 | end 71 | 72 | else begin 73 | $display("Test 3 passed!"); 74 | end 75 | 76 | // Tick 4: Inputs = 1'b0, 1'b0, 1'b0, 1'b1, 1'b0, 1'b0, 1'b1, 1'b0, Generated = p1y, p2y, Reference = 1'b1, 1'b1 77 | p1a = 1'b0; p1b = 1'b0; p1c = 1'b0; p1d = 1'b1; p2a = 1'b0; p2b = 1'b0; p2c = 1'b1; p2d = 1'b0; // Set input values 78 | #period; 79 | if (!(p1y === 1'b1 && p2y === 1'b1)) begin 80 | $display("Mismatch at index 4: Inputs = [%b, %b, %b, %b, %b, %b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 1'b0, 1'b0, 1'b0, 1'b1, 1'b0, 1'b0, 1'b1, 1'b0, p1y, p2y, 1'b1, 1'b1); 81 | mismatch_count = mismatch_count + 1; 82 | end 83 | 84 | else begin 85 | $display("Test 4 passed!"); 86 | end 87 | 88 | // Tick 5: Inputs = 1'b0, 1'b0, 1'b1, 1'b0, 1'b0, 1'b0, 1'b1, 1'b1, Generated = p1y, p2y, Reference = 1'b1, 1'b1 89 | p1a = 1'b0; p1b = 1'b0; p1c = 1'b1; p1d = 1'b0; p2a = 1'b0; p2b = 1'b0; p2c = 1'b1; p2d = 1'b1; // Set input values 90 | #period; 91 | if (!(p1y === 1'b1 && p2y === 1'b1)) begin 92 | $display("Mismatch at index 5: Inputs = [%b, %b, %b, %b, %b, %b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 1'b0, 1'b0, 1'b1, 1'b0, 1'b0, 1'b0, 1'b1, 1'b1, p1y, p2y, 1'b1, 1'b1); 93 | mismatch_count = mismatch_count + 1; 94 | end 95 | 96 | else begin 97 | $display("Test 5 passed!"); 98 | end 99 | 100 | // Tick 6: Inputs = 1'b0, 1'b0, 1'b1, 1'b0, 1'b0, 1'b0, 1'b1, 1'b1, Generated = p1y, p2y, Reference = 1'b1, 1'b1 101 | p1a = 1'b0; p1b = 1'b0; p1c = 1'b1; p1d = 1'b0; p2a = 1'b0; p2b = 1'b0; p2c = 1'b1; p2d = 1'b1; // Set input values 102 | #period; 103 | if (!(p1y === 1'b1 && p2y === 1'b1)) begin 104 | $display("Mismatch at index 6: Inputs = [%b, %b, %b, %b, %b, %b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 1'b0, 1'b0, 1'b1, 1'b0, 1'b0, 1'b0, 1'b1, 1'b1, p1y, p2y, 1'b1, 1'b1); 105 | mismatch_count = mismatch_count + 1; 106 | end 107 | 108 | else begin 109 | $display("Test 6 passed!"); 110 | end 111 | 112 | // Tick 7: Inputs = 1'b0, 1'b0, 1'b1, 1'b1, 1'b0, 1'b1, 1'b0, 1'b0, Generated = p1y, p2y, Reference = 1'b1, 1'b1 113 | p1a = 1'b0; p1b = 1'b0; p1c = 1'b1; p1d = 1'b1; p2a = 1'b0; p2b = 1'b1; p2c = 1'b0; p2d = 1'b0; // Set input values 114 | #period; 115 | if (!(p1y === 1'b1 && p2y === 1'b1)) begin 116 | $display("Mismatch at index 7: Inputs = [%b, %b, %b, %b, %b, %b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 1'b0, 1'b0, 1'b1, 1'b1, 1'b0, 1'b1, 1'b0, 1'b0, p1y, p2y, 1'b1, 1'b1); 117 | mismatch_count = mismatch_count + 1; 118 | end 119 | 120 | else begin 121 | $display("Test 7 passed!"); 122 | end 123 | 124 | // Tick 8: Inputs = 1'b0, 1'b0, 1'b1, 1'b1, 1'b0, 1'b1, 1'b0, 1'b0, Generated = p1y, p2y, Reference = 1'b1, 1'b1 125 | p1a = 1'b0; p1b = 1'b0; p1c = 1'b1; p1d = 1'b1; p2a = 1'b0; p2b = 1'b1; p2c = 1'b0; p2d = 1'b0; // Set input values 126 | #period; 127 | if (!(p1y === 1'b1 && p2y === 1'b1)) begin 128 | $display("Mismatch at index 8: Inputs = [%b, %b, %b, %b, %b, %b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 1'b0, 1'b0, 1'b1, 1'b1, 1'b0, 1'b1, 1'b0, 1'b0, p1y, p2y, 1'b1, 1'b1); 129 | mismatch_count = mismatch_count + 1; 130 | end 131 | 132 | else begin 133 | $display("Test 8 passed!"); 134 | end 135 | 136 | // Tick 9: Inputs = 1'b0, 1'b1, 1'b0, 1'b0, 1'b0, 1'b1, 1'b0, 1'b1, Generated = p1y, p2y, Reference = 1'b1, 1'b1 137 | p1a = 1'b0; p1b = 1'b1; p1c = 1'b0; p1d = 1'b0; p2a = 1'b0; p2b = 1'b1; p2c = 1'b0; p2d = 1'b1; // Set input values 138 | #period; 139 | if (!(p1y === 1'b1 && p2y === 1'b1)) begin 140 | $display("Mismatch at index 9: Inputs = [%b, %b, %b, %b, %b, %b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 1'b0, 1'b1, 1'b0, 1'b0, 1'b0, 1'b1, 1'b0, 1'b1, p1y, p2y, 1'b1, 1'b1); 141 | mismatch_count = mismatch_count + 1; 142 | end 143 | 144 | else begin 145 | $display("Test 9 passed!"); 146 | end 147 | 148 | // Tick 10: Inputs = 1'b0, 1'b1, 1'b0, 1'b0, 1'b0, 1'b1, 1'b0, 1'b1, Generated = p1y, p2y, Reference = 1'b1, 1'b1 149 | p1a = 1'b0; p1b = 1'b1; p1c = 1'b0; p1d = 1'b0; p2a = 1'b0; p2b = 1'b1; p2c = 1'b0; p2d = 1'b1; // Set input values 150 | #period; 151 | if (!(p1y === 1'b1 && p2y === 1'b1)) begin 152 | $display("Mismatch at index 10: Inputs = [%b, %b, %b, %b, %b, %b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 1'b0, 1'b1, 1'b0, 1'b0, 1'b0, 1'b1, 1'b0, 1'b1, p1y, p2y, 1'b1, 1'b1); 153 | mismatch_count = mismatch_count + 1; 154 | end 155 | 156 | else begin 157 | $display("Test 10 passed!"); 158 | end 159 | 160 | // Tick 11: Inputs = 1'b0, 1'b1, 1'b0, 1'b1, 1'b0, 1'b1, 1'b1, 1'b0, Generated = p1y, p2y, Reference = 1'b1, 1'b1 161 | p1a = 1'b0; p1b = 1'b1; p1c = 1'b0; p1d = 1'b1; p2a = 1'b0; p2b = 1'b1; p2c = 1'b1; p2d = 1'b0; // Set input values 162 | #period; 163 | if (!(p1y === 1'b1 && p2y === 1'b1)) begin 164 | $display("Mismatch at index 11: Inputs = [%b, %b, %b, %b, %b, %b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 1'b0, 1'b1, 1'b0, 1'b1, 1'b0, 1'b1, 1'b1, 1'b0, p1y, p2y, 1'b1, 1'b1); 165 | mismatch_count = mismatch_count + 1; 166 | end 167 | 168 | else begin 169 | $display("Test 11 passed!"); 170 | end 171 | 172 | // Tick 12: Inputs = 1'b0, 1'b1, 1'b0, 1'b1, 1'b0, 1'b1, 1'b1, 1'b0, Generated = p1y, p2y, Reference = 1'b1, 1'b1 173 | p1a = 1'b0; p1b = 1'b1; p1c = 1'b0; p1d = 1'b1; p2a = 1'b0; p2b = 1'b1; p2c = 1'b1; p2d = 1'b0; // Set input values 174 | #period; 175 | if (!(p1y === 1'b1 && p2y === 1'b1)) begin 176 | $display("Mismatch at index 12: Inputs = [%b, %b, %b, %b, %b, %b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 1'b0, 1'b1, 1'b0, 1'b1, 1'b0, 1'b1, 1'b1, 1'b0, p1y, p2y, 1'b1, 1'b1); 177 | mismatch_count = mismatch_count + 1; 178 | end 179 | 180 | else begin 181 | $display("Test 12 passed!"); 182 | end 183 | 184 | // Tick 13: Inputs = 1'b0, 1'b1, 1'b1, 1'b0, 1'b0, 1'b1, 1'b1, 1'b1, Generated = p1y, p2y, Reference = 1'b1, 1'b1 185 | p1a = 1'b0; p1b = 1'b1; p1c = 1'b1; p1d = 1'b0; p2a = 1'b0; p2b = 1'b1; p2c = 1'b1; p2d = 1'b1; // Set input values 186 | #period; 187 | if (!(p1y === 1'b1 && p2y === 1'b1)) begin 188 | $display("Mismatch at index 13: Inputs = [%b, %b, %b, %b, %b, %b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 1'b0, 1'b1, 1'b1, 1'b0, 1'b0, 1'b1, 1'b1, 1'b1, p1y, p2y, 1'b1, 1'b1); 189 | mismatch_count = mismatch_count + 1; 190 | end 191 | 192 | else begin 193 | $display("Test 13 passed!"); 194 | end 195 | 196 | // Tick 14: Inputs = 1'b0, 1'b1, 1'b1, 1'b0, 1'b0, 1'b1, 1'b1, 1'b1, Generated = p1y, p2y, Reference = 1'b1, 1'b1 197 | p1a = 1'b0; p1b = 1'b1; p1c = 1'b1; p1d = 1'b0; p2a = 1'b0; p2b = 1'b1; p2c = 1'b1; p2d = 1'b1; // Set input values 198 | #period; 199 | if (!(p1y === 1'b1 && p2y === 1'b1)) begin 200 | $display("Mismatch at index 14: Inputs = [%b, %b, %b, %b, %b, %b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 1'b0, 1'b1, 1'b1, 1'b0, 1'b0, 1'b1, 1'b1, 1'b1, p1y, p2y, 1'b1, 1'b1); 201 | mismatch_count = mismatch_count + 1; 202 | end 203 | 204 | else begin 205 | $display("Test 14 passed!"); 206 | end 207 | 208 | // Tick 15: Inputs = 1'b0, 1'b1, 1'b1, 1'b1, 1'b1, 1'b0, 1'b0, 1'b0, Generated = p1y, p2y, Reference = 1'b1, 1'b1 209 | p1a = 1'b0; p1b = 1'b1; p1c = 1'b1; p1d = 1'b1; p2a = 1'b1; p2b = 1'b0; p2c = 1'b0; p2d = 1'b0; // Set input values 210 | #period; 211 | if (!(p1y === 1'b1 && p2y === 1'b1)) begin 212 | $display("Mismatch at index 15: Inputs = [%b, %b, %b, %b, %b, %b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 1'b0, 1'b1, 1'b1, 1'b1, 1'b1, 1'b0, 1'b0, 1'b0, p1y, p2y, 1'b1, 1'b1); 213 | mismatch_count = mismatch_count + 1; 214 | end 215 | 216 | else begin 217 | $display("Test 15 passed!"); 218 | end 219 | 220 | // Tick 16: Inputs = 1'b0, 1'b1, 1'b1, 1'b1, 1'b1, 1'b0, 1'b0, 1'b0, Generated = p1y, p2y, Reference = 1'b1, 1'b1 221 | p1a = 1'b0; p1b = 1'b1; p1c = 1'b1; p1d = 1'b1; p2a = 1'b1; p2b = 1'b0; p2c = 1'b0; p2d = 1'b0; // Set input values 222 | #period; 223 | if (!(p1y === 1'b1 && p2y === 1'b1)) begin 224 | $display("Mismatch at index 16: Inputs = [%b, %b, %b, %b, %b, %b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 1'b0, 1'b1, 1'b1, 1'b1, 1'b1, 1'b0, 1'b0, 1'b0, p1y, p2y, 1'b1, 1'b1); 225 | mismatch_count = mismatch_count + 1; 226 | end 227 | 228 | else begin 229 | $display("Test 16 passed!"); 230 | end 231 | 232 | // Tick 17: Inputs = 1'b1, 1'b0, 1'b0, 1'b0, 1'b1, 1'b0, 1'b0, 1'b1, Generated = p1y, p2y, Reference = 1'b1, 1'b1 233 | p1a = 1'b1; p1b = 1'b0; p1c = 1'b0; p1d = 1'b0; p2a = 1'b1; p2b = 1'b0; p2c = 1'b0; p2d = 1'b1; // Set input values 234 | #period; 235 | if (!(p1y === 1'b1 && p2y === 1'b1)) begin 236 | $display("Mismatch at index 17: Inputs = [%b, %b, %b, %b, %b, %b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 1'b1, 1'b0, 1'b0, 1'b0, 1'b1, 1'b0, 1'b0, 1'b1, p1y, p2y, 1'b1, 1'b1); 237 | mismatch_count = mismatch_count + 1; 238 | end 239 | 240 | else begin 241 | $display("Test 17 passed!"); 242 | end 243 | 244 | // Tick 18: Inputs = 1'b1, 1'b0, 1'b0, 1'b0, 1'b1, 1'b0, 1'b0, 1'b1, Generated = p1y, p2y, Reference = 1'b1, 1'b1 245 | p1a = 1'b1; p1b = 1'b0; p1c = 1'b0; p1d = 1'b0; p2a = 1'b1; p2b = 1'b0; p2c = 1'b0; p2d = 1'b1; // Set input values 246 | #period; 247 | if (!(p1y === 1'b1 && p2y === 1'b1)) begin 248 | $display("Mismatch at index 18: Inputs = [%b, %b, %b, %b, %b, %b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 1'b1, 1'b0, 1'b0, 1'b0, 1'b1, 1'b0, 1'b0, 1'b1, p1y, p2y, 1'b1, 1'b1); 249 | mismatch_count = mismatch_count + 1; 250 | end 251 | 252 | else begin 253 | $display("Test 18 passed!"); 254 | end 255 | 256 | // Tick 19: Inputs = 1'b1, 1'b0, 1'b0, 1'b1, 1'b1, 1'b0, 1'b1, 1'b0, Generated = p1y, p2y, Reference = 1'b1, 1'b1 257 | p1a = 1'b1; p1b = 1'b0; p1c = 1'b0; p1d = 1'b1; p2a = 1'b1; p2b = 1'b0; p2c = 1'b1; p2d = 1'b0; // Set input values 258 | #period; 259 | if (!(p1y === 1'b1 && p2y === 1'b1)) begin 260 | $display("Mismatch at index 19: Inputs = [%b, %b, %b, %b, %b, %b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 1'b1, 1'b0, 1'b0, 1'b1, 1'b1, 1'b0, 1'b1, 1'b0, p1y, p2y, 1'b1, 1'b1); 261 | mismatch_count = mismatch_count + 1; 262 | end 263 | 264 | else begin 265 | $display("Test 19 passed!"); 266 | end 267 | 268 | // Tick 20: Inputs = 1'b1, 1'b0, 1'b0, 1'b1, 1'b1, 1'b0, 1'b1, 1'b0, Generated = p1y, p2y, Reference = 1'b1, 1'b1 269 | p1a = 1'b1; p1b = 1'b0; p1c = 1'b0; p1d = 1'b1; p2a = 1'b1; p2b = 1'b0; p2c = 1'b1; p2d = 1'b0; // Set input values 270 | #period; 271 | if (!(p1y === 1'b1 && p2y === 1'b1)) begin 272 | $display("Mismatch at index 20: Inputs = [%b, %b, %b, %b, %b, %b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 1'b1, 1'b0, 1'b0, 1'b1, 1'b1, 1'b0, 1'b1, 1'b0, p1y, p2y, 1'b1, 1'b1); 273 | mismatch_count = mismatch_count + 1; 274 | end 275 | 276 | else begin 277 | $display("Test 20 passed!"); 278 | end 279 | 280 | // Tick 21: Inputs = 1'b1, 1'b0, 1'b1, 1'b0, 1'b1, 1'b0, 1'b1, 1'b1, Generated = p1y, p2y, Reference = 1'b1, 1'b1 281 | p1a = 1'b1; p1b = 1'b0; p1c = 1'b1; p1d = 1'b0; p2a = 1'b1; p2b = 1'b0; p2c = 1'b1; p2d = 1'b1; // Set input values 282 | #period; 283 | if (!(p1y === 1'b1 && p2y === 1'b1)) begin 284 | $display("Mismatch at index 21: Inputs = [%b, %b, %b, %b, %b, %b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 1'b1, 1'b0, 1'b1, 1'b0, 1'b1, 1'b0, 1'b1, 1'b1, p1y, p2y, 1'b1, 1'b1); 285 | mismatch_count = mismatch_count + 1; 286 | end 287 | 288 | else begin 289 | $display("Test 21 passed!"); 290 | end 291 | 292 | // Tick 22: Inputs = 1'b1, 1'b0, 1'b1, 1'b0, 1'b1, 1'b0, 1'b1, 1'b1, Generated = p1y, p2y, Reference = 1'b1, 1'b1 293 | p1a = 1'b1; p1b = 1'b0; p1c = 1'b1; p1d = 1'b0; p2a = 1'b1; p2b = 1'b0; p2c = 1'b1; p2d = 1'b1; // Set input values 294 | #period; 295 | if (!(p1y === 1'b1 && p2y === 1'b1)) begin 296 | $display("Mismatch at index 22: Inputs = [%b, %b, %b, %b, %b, %b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 1'b1, 1'b0, 1'b1, 1'b0, 1'b1, 1'b0, 1'b1, 1'b1, p1y, p2y, 1'b1, 1'b1); 297 | mismatch_count = mismatch_count + 1; 298 | end 299 | 300 | else begin 301 | $display("Test 22 passed!"); 302 | end 303 | 304 | // Tick 23: Inputs = 1'b1, 1'b0, 1'b1, 1'b1, 1'b1, 1'b1, 1'b0, 1'b0, Generated = p1y, p2y, Reference = 1'b1, 1'b1 305 | p1a = 1'b1; p1b = 1'b0; p1c = 1'b1; p1d = 1'b1; p2a = 1'b1; p2b = 1'b1; p2c = 1'b0; p2d = 1'b0; // Set input values 306 | #period; 307 | if (!(p1y === 1'b1 && p2y === 1'b1)) begin 308 | $display("Mismatch at index 23: Inputs = [%b, %b, %b, %b, %b, %b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 1'b1, 1'b0, 1'b1, 1'b1, 1'b1, 1'b1, 1'b0, 1'b0, p1y, p2y, 1'b1, 1'b1); 309 | mismatch_count = mismatch_count + 1; 310 | end 311 | 312 | else begin 313 | $display("Test 23 passed!"); 314 | end 315 | 316 | // Tick 24: Inputs = 1'b1, 1'b0, 1'b1, 1'b1, 1'b1, 1'b1, 1'b0, 1'b0, Generated = p1y, p2y, Reference = 1'b1, 1'b1 317 | p1a = 1'b1; p1b = 1'b0; p1c = 1'b1; p1d = 1'b1; p2a = 1'b1; p2b = 1'b1; p2c = 1'b0; p2d = 1'b0; // Set input values 318 | #period; 319 | if (!(p1y === 1'b1 && p2y === 1'b1)) begin 320 | $display("Mismatch at index 24: Inputs = [%b, %b, %b, %b, %b, %b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 1'b1, 1'b0, 1'b1, 1'b1, 1'b1, 1'b1, 1'b0, 1'b0, p1y, p2y, 1'b1, 1'b1); 321 | mismatch_count = mismatch_count + 1; 322 | end 323 | 324 | else begin 325 | $display("Test 24 passed!"); 326 | end 327 | 328 | // Tick 25: Inputs = 1'b1, 1'b1, 1'b0, 1'b0, 1'b1, 1'b1, 1'b0, 1'b1, Generated = p1y, p2y, Reference = 1'b1, 1'b1 329 | p1a = 1'b1; p1b = 1'b1; p1c = 1'b0; p1d = 1'b0; p2a = 1'b1; p2b = 1'b1; p2c = 1'b0; p2d = 1'b1; // Set input values 330 | #period; 331 | if (!(p1y === 1'b1 && p2y === 1'b1)) begin 332 | $display("Mismatch at index 25: Inputs = [%b, %b, %b, %b, %b, %b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 1'b1, 1'b1, 1'b0, 1'b0, 1'b1, 1'b1, 1'b0, 1'b1, p1y, p2y, 1'b1, 1'b1); 333 | mismatch_count = mismatch_count + 1; 334 | end 335 | 336 | else begin 337 | $display("Test 25 passed!"); 338 | end 339 | 340 | // Tick 26: Inputs = 1'b1, 1'b1, 1'b0, 1'b0, 1'b1, 1'b1, 1'b0, 1'b1, Generated = p1y, p2y, Reference = 1'b1, 1'b1 341 | p1a = 1'b1; p1b = 1'b1; p1c = 1'b0; p1d = 1'b0; p2a = 1'b1; p2b = 1'b1; p2c = 1'b0; p2d = 1'b1; // Set input values 342 | #period; 343 | if (!(p1y === 1'b1 && p2y === 1'b1)) begin 344 | $display("Mismatch at index 26: Inputs = [%b, %b, %b, %b, %b, %b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 1'b1, 1'b1, 1'b0, 1'b0, 1'b1, 1'b1, 1'b0, 1'b1, p1y, p2y, 1'b1, 1'b1); 345 | mismatch_count = mismatch_count + 1; 346 | end 347 | 348 | else begin 349 | $display("Test 26 passed!"); 350 | end 351 | 352 | // Tick 27: Inputs = 1'b1, 1'b1, 1'b0, 1'b1, 1'b1, 1'b1, 1'b1, 1'b0, Generated = p1y, p2y, Reference = 1'b1, 1'b1 353 | p1a = 1'b1; p1b = 1'b1; p1c = 1'b0; p1d = 1'b1; p2a = 1'b1; p2b = 1'b1; p2c = 1'b1; p2d = 1'b0; // Set input values 354 | #period; 355 | if (!(p1y === 1'b1 && p2y === 1'b1)) begin 356 | $display("Mismatch at index 27: Inputs = [%b, %b, %b, %b, %b, %b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 1'b1, 1'b1, 1'b0, 1'b1, 1'b1, 1'b1, 1'b1, 1'b0, p1y, p2y, 1'b1, 1'b1); 357 | mismatch_count = mismatch_count + 1; 358 | end 359 | 360 | else begin 361 | $display("Test 27 passed!"); 362 | end 363 | 364 | // Tick 28: Inputs = 1'b1, 1'b1, 1'b0, 1'b1, 1'b1, 1'b1, 1'b1, 1'b0, Generated = p1y, p2y, Reference = 1'b1, 1'b1 365 | p1a = 1'b1; p1b = 1'b1; p1c = 1'b0; p1d = 1'b1; p2a = 1'b1; p2b = 1'b1; p2c = 1'b1; p2d = 1'b0; // Set input values 366 | #period; 367 | if (!(p1y === 1'b1 && p2y === 1'b1)) begin 368 | $display("Mismatch at index 28: Inputs = [%b, %b, %b, %b, %b, %b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 1'b1, 1'b1, 1'b0, 1'b1, 1'b1, 1'b1, 1'b1, 1'b0, p1y, p2y, 1'b1, 1'b1); 369 | mismatch_count = mismatch_count + 1; 370 | end 371 | 372 | else begin 373 | $display("Test 28 passed!"); 374 | end 375 | 376 | // Tick 29: Inputs = 1'b1, 1'b1, 1'b1, 1'b0, 1'b1, 1'b1, 1'b1, 1'b1, Generated = p1y, p2y, Reference = 1'b1, 1'b0 377 | p1a = 1'b1; p1b = 1'b1; p1c = 1'b1; p1d = 1'b0; p2a = 1'b1; p2b = 1'b1; p2c = 1'b1; p2d = 1'b1; // Set input values 378 | #period; 379 | if (!(p1y === 1'b1 && p2y === 1'b0)) begin 380 | $display("Mismatch at index 29: Inputs = [%b, %b, %b, %b, %b, %b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 1'b1, 1'b1, 1'b1, 1'b0, 1'b1, 1'b1, 1'b1, 1'b1, p1y, p2y, 1'b1, 1'b0); 381 | mismatch_count = mismatch_count + 1; 382 | end 383 | 384 | else begin 385 | $display("Test 29 passed!"); 386 | end 387 | 388 | // Tick 30: Inputs = 1'b1, 1'b1, 1'b1, 1'b0, 1'b1, 1'b1, 1'b1, 1'b1, Generated = p1y, p2y, Reference = 1'b1, 1'b0 389 | p1a = 1'b1; p1b = 1'b1; p1c = 1'b1; p1d = 1'b0; p2a = 1'b1; p2b = 1'b1; p2c = 1'b1; p2d = 1'b1; // Set input values 390 | #period; 391 | if (!(p1y === 1'b1 && p2y === 1'b0)) begin 392 | $display("Mismatch at index 30: Inputs = [%b, %b, %b, %b, %b, %b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 1'b1, 1'b1, 1'b1, 1'b0, 1'b1, 1'b1, 1'b1, 1'b1, p1y, p2y, 1'b1, 1'b0); 393 | mismatch_count = mismatch_count + 1; 394 | end 395 | 396 | else begin 397 | $display("Test 30 passed!"); 398 | end 399 | 400 | // Tick 31: Inputs = 1'b1, 1'b1, 1'b1, 1'b1, 1'b0, 1'b0, 1'b0, 1'b0, Generated = p1y, p2y, Reference = 1'b0, 1'b1 401 | p1a = 1'b1; p1b = 1'b1; p1c = 1'b1; p1d = 1'b1; p2a = 1'b0; p2b = 1'b0; p2c = 1'b0; p2d = 1'b0; // Set input values 402 | #period; 403 | if (!(p1y === 1'b0 && p2y === 1'b1)) begin 404 | $display("Mismatch at index 31: Inputs = [%b, %b, %b, %b, %b, %b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 1'b1, 1'b1, 1'b1, 1'b1, 1'b0, 1'b0, 1'b0, 1'b0, p1y, p2y, 1'b0, 1'b1); 405 | mismatch_count = mismatch_count + 1; 406 | end 407 | 408 | else begin 409 | $display("Test 31 passed!"); 410 | end 411 | 412 | // Tick 32: Inputs = 1'b1, 1'b1, 1'b1, 1'b1, 1'b0, 1'b0, 1'b0, 1'b0, Generated = p1y, p2y, Reference = 1'b0, 1'b1 413 | p1a = 1'b1; p1b = 1'b1; p1c = 1'b1; p1d = 1'b1; p2a = 1'b0; p2b = 1'b0; p2c = 1'b0; p2d = 1'b0; // Set input values 414 | #period; 415 | if (!(p1y === 1'b0 && p2y === 1'b1)) begin 416 | $display("Mismatch at index 32: Inputs = [%b, %b, %b, %b, %b, %b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 1'b1, 1'b1, 1'b1, 1'b1, 1'b0, 1'b0, 1'b0, 1'b0, p1y, p2y, 1'b0, 1'b1); 417 | mismatch_count = mismatch_count + 1; 418 | end 419 | 420 | else begin 421 | $display("Test 32 passed!"); 422 | end 423 | 424 | // Tick 33: Inputs = 1'b0, 1'b0, 1'b0, 1'b0, 1'b0, 1'b0, 1'b0, 1'b1, Generated = p1y, p2y, Reference = 1'b1, 1'b1 425 | p1a = 1'b0; p1b = 1'b0; p1c = 1'b0; p1d = 1'b0; p2a = 1'b0; p2b = 1'b0; p2c = 1'b0; p2d = 1'b1; // Set input values 426 | #period; 427 | if (!(p1y === 1'b1 && p2y === 1'b1)) begin 428 | $display("Mismatch at index 33: Inputs = [%b, %b, %b, %b, %b, %b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 1'b0, 1'b0, 1'b0, 1'b0, 1'b0, 1'b0, 1'b0, 1'b1, p1y, p2y, 1'b1, 1'b1); 429 | mismatch_count = mismatch_count + 1; 430 | end 431 | 432 | else begin 433 | $display("Test 33 passed!"); 434 | end 435 | 436 | // Tick 34: Inputs = 1'b0, 1'b0, 1'b0, 1'b0, 1'b0, 1'b0, 1'b0, 1'b1, Generated = p1y, p2y, Reference = 1'b1, 1'b1 437 | p1a = 1'b0; p1b = 1'b0; p1c = 1'b0; p1d = 1'b0; p2a = 1'b0; p2b = 1'b0; p2c = 1'b0; p2d = 1'b1; // Set input values 438 | #period; 439 | if (!(p1y === 1'b1 && p2y === 1'b1)) begin 440 | $display("Mismatch at index 34: Inputs = [%b, %b, %b, %b, %b, %b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 1'b0, 1'b0, 1'b0, 1'b0, 1'b0, 1'b0, 1'b0, 1'b1, p1y, p2y, 1'b1, 1'b1); 441 | mismatch_count = mismatch_count + 1; 442 | end 443 | 444 | else begin 445 | $display("Test 34 passed!"); 446 | end 447 | 448 | // Tick 35: Inputs = 1'b0, 1'b0, 1'b0, 1'b1, 1'b0, 1'b0, 1'b1, 1'b0, Generated = p1y, p2y, Reference = 1'b1, 1'b1 449 | p1a = 1'b0; p1b = 1'b0; p1c = 1'b0; p1d = 1'b1; p2a = 1'b0; p2b = 1'b0; p2c = 1'b1; p2d = 1'b0; // Set input values 450 | #period; 451 | if (!(p1y === 1'b1 && p2y === 1'b1)) begin 452 | $display("Mismatch at index 35: Inputs = [%b, %b, %b, %b, %b, %b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 1'b0, 1'b0, 1'b0, 1'b1, 1'b0, 1'b0, 1'b1, 1'b0, p1y, p2y, 1'b1, 1'b1); 453 | mismatch_count = mismatch_count + 1; 454 | end 455 | 456 | else begin 457 | $display("Test 35 passed!"); 458 | end 459 | 460 | // Tick 36: Inputs = 1'b0, 1'b0, 1'b0, 1'b1, 1'b0, 1'b0, 1'b1, 1'b0, Generated = p1y, p2y, Reference = 1'b1, 1'b1 461 | p1a = 1'b0; p1b = 1'b0; p1c = 1'b0; p1d = 1'b1; p2a = 1'b0; p2b = 1'b0; p2c = 1'b1; p2d = 1'b0; // Set input values 462 | #period; 463 | if (!(p1y === 1'b1 && p2y === 1'b1)) begin 464 | $display("Mismatch at index 36: Inputs = [%b, %b, %b, %b, %b, %b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 1'b0, 1'b0, 1'b0, 1'b1, 1'b0, 1'b0, 1'b1, 1'b0, p1y, p2y, 1'b1, 1'b1); 465 | mismatch_count = mismatch_count + 1; 466 | end 467 | 468 | else begin 469 | $display("Test 36 passed!"); 470 | end 471 | 472 | // Tick 37: Inputs = 1'b0, 1'b0, 1'b1, 1'b0, 1'b0, 1'b0, 1'b1, 1'b1, Generated = p1y, p2y, Reference = 1'b1, 1'b1 473 | p1a = 1'b0; p1b = 1'b0; p1c = 1'b1; p1d = 1'b0; p2a = 1'b0; p2b = 1'b0; p2c = 1'b1; p2d = 1'b1; // Set input values 474 | #period; 475 | if (!(p1y === 1'b1 && p2y === 1'b1)) begin 476 | $display("Mismatch at index 37: Inputs = [%b, %b, %b, %b, %b, %b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 1'b0, 1'b0, 1'b1, 1'b0, 1'b0, 1'b0, 1'b1, 1'b1, p1y, p2y, 1'b1, 1'b1); 477 | mismatch_count = mismatch_count + 1; 478 | end 479 | 480 | else begin 481 | $display("Test 37 passed!"); 482 | end 483 | 484 | // Tick 38: Inputs = 1'b0, 1'b0, 1'b1, 1'b0, 1'b0, 1'b0, 1'b1, 1'b1, Generated = p1y, p2y, Reference = 1'b1, 1'b1 485 | p1a = 1'b0; p1b = 1'b0; p1c = 1'b1; p1d = 1'b0; p2a = 1'b0; p2b = 1'b0; p2c = 1'b1; p2d = 1'b1; // Set input values 486 | #period; 487 | if (!(p1y === 1'b1 && p2y === 1'b1)) begin 488 | $display("Mismatch at index 38: Inputs = [%b, %b, %b, %b, %b, %b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 1'b0, 1'b0, 1'b1, 1'b0, 1'b0, 1'b0, 1'b1, 1'b1, p1y, p2y, 1'b1, 1'b1); 489 | mismatch_count = mismatch_count + 1; 490 | end 491 | 492 | else begin 493 | $display("Test 38 passed!"); 494 | end 495 | 496 | if (mismatch_count == 0) 497 | $display("All tests passed!"); 498 | else 499 | $display("%0d mismatches out of %0d total tests.", mismatch_count, 39); 500 | $finish; 501 | end 502 | 503 | endmodule 504 | -------------------------------------------------------------------------------- /demo_files/AutoChip/DATE/Adder3_0_tb.v: -------------------------------------------------------------------------------- 1 | `timescale 1 ns/10 ps // time-unit = 1 ns, precision = 10 ps 2 | 3 | module top_module_tb; 4 | 5 | // duration for each bit = 20 * timescale = 20 * 1 ns = 20ns 6 | localparam period = 20; 7 | 8 | reg [2:0] a; 9 | reg [2:0] b; 10 | reg cin; 11 | 12 | wire [2:0] cout; 13 | wire [2:0] sum; 14 | 15 | 16 | integer mismatch_count; 17 | 18 | top_module UUT (.a(a), .b(b), .cin(cin), .cout(cout), .sum(sum)); 19 | 20 | initial begin 21 | mismatch_count = 0; 22 | 23 | // Tick 0: Inputs = 3'b010, 3'b011, 1'b0, Generated = cout, sum, Reference = 3'b010, 3'b101 24 | a = 3'b010; b = 3'b011; cin = 1'b0; // Set input values 25 | #period; 26 | if (!(cout === 3'b010 && sum === 3'b101)) begin 27 | $display("Mismatch at index 0: Inputs = [%b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 3'b010, 3'b011, 1'b0, cout, sum, 3'b010, 3'b101); 28 | mismatch_count = mismatch_count + 1; 29 | end 30 | 31 | else begin 32 | $display("Test 0 passed!"); 33 | end 34 | 35 | // Tick 1: Inputs = 3'b010, 3'b011, 1'b0, Generated = cout, sum, Reference = 3'b010, 3'b101 36 | a = 3'b010; b = 3'b011; cin = 1'b0; // Set input values 37 | #period; 38 | if (!(cout === 3'b010 && sum === 3'b101)) begin 39 | $display("Mismatch at index 1: Inputs = [%b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 3'b010, 3'b011, 1'b0, cout, sum, 3'b010, 3'b101); 40 | mismatch_count = mismatch_count + 1; 41 | end 42 | 43 | else begin 44 | $display("Test 1 passed!"); 45 | end 46 | 47 | // Tick 2: Inputs = 3'b010, 3'b011, 1'b1, Generated = cout, sum, Reference = 3'b011, 3'b110 48 | a = 3'b010; b = 3'b011; cin = 1'b1; // Set input values 49 | #period; 50 | if (!(cout === 3'b011 && sum === 3'b110)) begin 51 | $display("Mismatch at index 2: Inputs = [%b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 3'b010, 3'b011, 1'b1, cout, sum, 3'b011, 3'b110); 52 | mismatch_count = mismatch_count + 1; 53 | end 54 | 55 | else begin 56 | $display("Test 2 passed!"); 57 | end 58 | 59 | // Tick 3: Inputs = 3'b010, 3'b011, 1'b1, Generated = cout, sum, Reference = 3'b011, 3'b110 60 | a = 3'b010; b = 3'b011; cin = 1'b1; // Set input values 61 | #period; 62 | if (!(cout === 3'b011 && sum === 3'b110)) begin 63 | $display("Mismatch at index 3: Inputs = [%b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 3'b010, 3'b011, 1'b1, cout, sum, 3'b011, 3'b110); 64 | mismatch_count = mismatch_count + 1; 65 | end 66 | 67 | else begin 68 | $display("Test 3 passed!"); 69 | end 70 | 71 | if (mismatch_count == 0) 72 | $display("All tests passed!"); 73 | else 74 | $display("%0d mismatches out of %0d total tests.", mismatch_count, 4); 75 | $finish; 76 | end 77 | 78 | endmodule 79 | -------------------------------------------------------------------------------- /demo_files/AutoChip/DATE/Rule90_0_tb.v: -------------------------------------------------------------------------------- 1 | `timescale 1 ns/10 ps // time-unit = 1 ns, precision = 10 ps 2 | 3 | module top_module_tb; 4 | 5 | // duration for each bit = 20 * timescale = 20 * 1 ns = 20ns 6 | localparam period = 20; 7 | 8 | reg clk; 9 | reg load; 10 | reg [511:0] data; 11 | 12 | wire [511:0] q; 13 | 14 | 15 | integer mismatch_count; 16 | 17 | top_module UUT (.clk(clk), .load(load), .data(data), .q(q)); 18 | 19 | initial // clk generation 20 | begin 21 | clk = 0; 22 | forever begin 23 | #(period/2); 24 | clk = ~clk; 25 | end 26 | end 27 | 28 | initial begin 29 | mismatch_count = 0; 30 | 31 | // Tick 0: Inputs = 1'b1, 1'b1, 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001, Generated = q, Reference = 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001 32 | load = 1'b1; data = 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001; // Set input values 33 | #period; 34 | if (!(q === 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001)) begin 35 | $display("Mismatch at index 0: Inputs = [%b, %b, %b], Generated = [%b], Reference = [%b]", 1'b1, 1'b1, 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001, q, 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001); 36 | mismatch_count = mismatch_count + 1; 37 | end 38 | 39 | else begin 40 | $display("Test 0 passed!"); 41 | end 42 | 43 | // Tick 1: Inputs = 1'b0, 1'b1, 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001, Generated = q, Reference = 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001 44 | load = 1'b1; data = 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001; // Set input values 45 | #period; 46 | if (!(q === 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001)) begin 47 | $display("Mismatch at index 1: Inputs = [%b, %b, %b], Generated = [%b], Reference = [%b]", 1'b0, 1'b1, 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001, q, 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001); 48 | mismatch_count = mismatch_count + 1; 49 | end 50 | 51 | else begin 52 | $display("Test 1 passed!"); 53 | end 54 | 55 | // Tick 2: Inputs = 1'b1, 1'b1, 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001, Generated = q, Reference = 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001 56 | load = 1'b1; data = 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001; // Set input values 57 | #period; 58 | if (!(q === 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001)) begin 59 | $display("Mismatch at index 2: Inputs = [%b, %b, %b], Generated = [%b], Reference = [%b]", 1'b1, 1'b1, 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001, q, 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001); 60 | mismatch_count = mismatch_count + 1; 61 | end 62 | 63 | else begin 64 | $display("Test 2 passed!"); 65 | end 66 | 67 | // Tick 3: Inputs = 1'b0, 1'b1, 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001, Generated = q, Reference = 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001 68 | load = 1'b1; data = 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001; // Set input values 69 | #period; 70 | if (!(q === 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001)) begin 71 | $display("Mismatch at index 3: Inputs = [%b, %b, %b], Generated = [%b], Reference = [%b]", 1'b0, 1'b1, 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001, q, 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001); 72 | mismatch_count = mismatch_count + 1; 73 | end 74 | 75 | else begin 76 | $display("Test 3 passed!"); 77 | end 78 | 79 | // Tick 4: Inputs = 1'b1, 1'b0, 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001, Generated = q, Reference = 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001 80 | load = 1'b0; data = 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001; // Set input values 81 | #period; 82 | if (!(q === 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001)) begin 83 | $display("Mismatch at index 4: Inputs = [%b, %b, %b], Generated = [%b], Reference = [%b]", 1'b1, 1'b0, 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001, q, 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001); 84 | mismatch_count = mismatch_count + 1; 85 | end 86 | 87 | else begin 88 | $display("Test 4 passed!"); 89 | end 90 | 91 | // Tick 5: Inputs = 1'b0, 1'b0, 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001, Generated = q, Reference = 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001 92 | load = 1'b0; data = 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001; // Set input values 93 | #period; 94 | if (!(q === 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001)) begin 95 | $display("Mismatch at index 5: Inputs = [%b, %b, %b], Generated = [%b], Reference = [%b]", 1'b0, 1'b0, 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001, q, 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001); 96 | mismatch_count = mismatch_count + 1; 97 | end 98 | 99 | else begin 100 | $display("Test 5 passed!"); 101 | end 102 | 103 | // Tick 6: Inputs = 1'b1, 1'b0, 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001, Generated = q, Reference = 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010 104 | load = 1'b0; data = 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001; // Set input values 105 | #period; 106 | if (!(q === 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010)) begin 107 | $display("Mismatch at index 6: Inputs = [%b, %b, %b], Generated = [%b], Reference = [%b]", 1'b1, 1'b0, 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001, q, 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010); 108 | mismatch_count = mismatch_count + 1; 109 | end 110 | 111 | else begin 112 | $display("Test 6 passed!"); 113 | end 114 | 115 | // Tick 7: Inputs = 1'b0, 1'b0, 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001, Generated = q, Reference = 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010 116 | load = 1'b0; data = 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001; // Set input values 117 | #period; 118 | if (!(q === 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010)) begin 119 | $display("Mismatch at index 7: Inputs = [%b, %b, %b], Generated = [%b], Reference = [%b]", 1'b0, 1'b0, 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001, q, 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010); 120 | mismatch_count = mismatch_count + 1; 121 | end 122 | 123 | else begin 124 | $display("Test 7 passed!"); 125 | end 126 | 127 | // Tick 8: Inputs = 1'b1, 1'b0, 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001, Generated = q, Reference = 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000101 128 | load = 1'b0; data = 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001; // Set input values 129 | #period; 130 | if (!(q === 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000101)) begin 131 | $display("Mismatch at index 8: Inputs = [%b, %b, %b], Generated = [%b], Reference = [%b]", 1'b1, 1'b0, 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001, q, 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000101); 132 | mismatch_count = mismatch_count + 1; 133 | end 134 | 135 | else begin 136 | $display("Test 8 passed!"); 137 | end 138 | 139 | // Tick 9: Inputs = 1'b0, 1'b0, 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001, Generated = q, Reference = 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000101 140 | load = 1'b0; data = 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001; // Set input values 141 | #period; 142 | if (!(q === 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000101)) begin 143 | $display("Mismatch at index 9: Inputs = [%b, %b, %b], Generated = [%b], Reference = [%b]", 1'b0, 1'b0, 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001, q, 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000101); 144 | mismatch_count = mismatch_count + 1; 145 | end 146 | 147 | else begin 148 | $display("Test 9 passed!"); 149 | end 150 | 151 | // Tick 10: Inputs = 1'b1, 1'b0, 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001, Generated = q, Reference = 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000 152 | load = 1'b0; data = 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001; // Set input values 153 | #period; 154 | if (!(q === 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000)) begin 155 | $display("Mismatch at index 10: Inputs = [%b, %b, %b], Generated = [%b], Reference = [%b]", 1'b1, 1'b0, 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001, q, 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000); 156 | mismatch_count = mismatch_count + 1; 157 | end 158 | 159 | else begin 160 | $display("Test 10 passed!"); 161 | end 162 | 163 | // Tick 11: Inputs = 1'b0, 1'b0, 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001, Generated = q, Reference = 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000 164 | load = 1'b0; data = 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001; // Set input values 165 | #period; 166 | if (!(q === 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000)) begin 167 | $display("Mismatch at index 11: Inputs = [%b, %b, %b], Generated = [%b], Reference = [%b]", 1'b0, 1'b0, 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001, q, 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000); 168 | mismatch_count = mismatch_count + 1; 169 | end 170 | 171 | else begin 172 | $display("Test 11 passed!"); 173 | end 174 | 175 | // Tick 12: Inputs = 1'b1, 1'b0, 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001, Generated = q, Reference = 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010100 176 | load = 1'b0; data = 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001; // Set input values 177 | #period; 178 | if (!(q === 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010100)) begin 179 | $display("Mismatch at index 12: Inputs = [%b, %b, %b], Generated = [%b], Reference = [%b]", 1'b1, 1'b0, 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001, q, 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010100); 180 | mismatch_count = mismatch_count + 1; 181 | end 182 | 183 | else begin 184 | $display("Test 12 passed!"); 185 | end 186 | 187 | // Tick 13: Inputs = 1'b0, 1'b0, 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001, Generated = q, Reference = 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010100 188 | load = 1'b0; data = 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001; // Set input values 189 | #period; 190 | if (!(q === 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010100)) begin 191 | $display("Mismatch at index 13: Inputs = [%b, %b, %b], Generated = [%b], Reference = [%b]", 1'b0, 1'b0, 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001, q, 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010100); 192 | mismatch_count = mismatch_count + 1; 193 | end 194 | 195 | else begin 196 | $display("Test 13 passed!"); 197 | end 198 | 199 | // Tick 14: Inputs = 1'b1, 1'b0, 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001, Generated = q, Reference = 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100010 200 | load = 1'b0; data = 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001; // Set input values 201 | #period; 202 | if (!(q === 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100010)) begin 203 | $display("Mismatch at index 14: Inputs = [%b, %b, %b], Generated = [%b], Reference = [%b]", 1'b1, 1'b0, 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001, q, 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100010); 204 | mismatch_count = mismatch_count + 1; 205 | end 206 | 207 | else begin 208 | $display("Test 14 passed!"); 209 | end 210 | 211 | // Tick 15: Inputs = 1'b0, 1'b0, 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001, Generated = q, Reference = 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100010 212 | load = 1'b0; data = 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001; // Set input values 213 | #period; 214 | if (!(q === 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100010)) begin 215 | $display("Mismatch at index 15: Inputs = [%b, %b, %b], Generated = [%b], Reference = [%b]", 1'b0, 1'b0, 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001, q, 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100010); 216 | mismatch_count = mismatch_count + 1; 217 | end 218 | 219 | else begin 220 | $display("Test 15 passed!"); 221 | end 222 | 223 | // Tick 16: Inputs = 1'b1, 1'b0, 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001, Generated = q, Reference = 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001010101 224 | load = 1'b0; data = 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001; // Set input values 225 | #period; 226 | if (!(q === 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001010101)) begin 227 | $display("Mismatch at index 16: Inputs = [%b, %b, %b], Generated = [%b], Reference = [%b]", 1'b1, 1'b0, 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001, q, 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001010101); 228 | mismatch_count = mismatch_count + 1; 229 | end 230 | 231 | else begin 232 | $display("Test 16 passed!"); 233 | end 234 | 235 | // Tick 17: Inputs = 1'b0, 1'b0, 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001, Generated = q, Reference = 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001010101 236 | load = 1'b0; data = 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001; // Set input values 237 | #period; 238 | if (!(q === 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001010101)) begin 239 | $display("Mismatch at index 17: Inputs = [%b, %b, %b], Generated = [%b], Reference = [%b]", 1'b0, 1'b0, 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001, q, 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001010101); 240 | mismatch_count = mismatch_count + 1; 241 | end 242 | 243 | else begin 244 | $display("Test 17 passed!"); 245 | end 246 | 247 | // Tick 18: Inputs = 1'b1, 1'b0, 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001, Generated = q, Reference = 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000 248 | load = 1'b0; data = 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001; // Set input values 249 | #period; 250 | if (!(q === 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000)) begin 251 | $display("Mismatch at index 18: Inputs = [%b, %b, %b], Generated = [%b], Reference = [%b]", 1'b1, 1'b0, 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001, q, 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000); 252 | mismatch_count = mismatch_count + 1; 253 | end 254 | 255 | else begin 256 | $display("Test 18 passed!"); 257 | end 258 | 259 | // Tick 19: Inputs = 1'b0, 1'b0, 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001, Generated = q, Reference = 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000 260 | load = 1'b0; data = 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001; // Set input values 261 | #period; 262 | if (!(q === 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000)) begin 263 | $display("Mismatch at index 19: Inputs = [%b, %b, %b], Generated = [%b], Reference = [%b]", 1'b0, 1'b0, 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001, q, 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000); 264 | mismatch_count = mismatch_count + 1; 265 | end 266 | 267 | else begin 268 | $display("Test 19 passed!"); 269 | end 270 | 271 | // Tick 20: Inputs = 1'b1, 1'b0, 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001, Generated = q, Reference = 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000101000000 272 | load = 1'b0; data = 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001; // Set input values 273 | #period; 274 | if (!(q === 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000101000000)) begin 275 | $display("Mismatch at index 20: Inputs = [%b, %b, %b], Generated = [%b], Reference = [%b]", 1'b1, 1'b0, 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001, q, 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000101000000); 276 | mismatch_count = mismatch_count + 1; 277 | end 278 | 279 | else begin 280 | $display("Test 20 passed!"); 281 | end 282 | 283 | // Tick 21: Inputs = 1'b0, 1'b0, 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001, Generated = q, Reference = 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000101000000 284 | load = 1'b0; data = 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001; // Set input values 285 | #period; 286 | if (!(q === 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000101000000)) begin 287 | $display("Mismatch at index 21: Inputs = [%b, %b, %b], Generated = [%b], Reference = [%b]", 1'b0, 1'b0, 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001, q, 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000101000000); 288 | mismatch_count = mismatch_count + 1; 289 | end 290 | 291 | else begin 292 | $display("Test 21 passed!"); 293 | end 294 | 295 | // Tick 22: Inputs = 1'b1, 1'b0, 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001, Generated = q, Reference = 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000100000 296 | load = 1'b0; data = 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001; // Set input values 297 | #period; 298 | if (!(q === 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000100000)) begin 299 | $display("Mismatch at index 22: Inputs = [%b, %b, %b], Generated = [%b], Reference = [%b]", 1'b1, 1'b0, 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001, q, 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000100000); 300 | mismatch_count = mismatch_count + 1; 301 | end 302 | 303 | else begin 304 | $display("Test 22 passed!"); 305 | end 306 | 307 | // Tick 23: Inputs = 1'b0, 1'b0, 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001, Generated = q, Reference = 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000100000 308 | load = 1'b0; data = 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001; // Set input values 309 | #period; 310 | if (!(q === 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000100000)) begin 311 | $display("Mismatch at index 23: Inputs = [%b, %b, %b], Generated = [%b], Reference = [%b]", 1'b0, 1'b0, 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001, q, 512'b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000100000); 312 | mismatch_count = mismatch_count + 1; 313 | end 314 | 315 | else begin 316 | $display("Test 23 passed!"); 317 | end 318 | 319 | if (mismatch_count == 0) 320 | $display("All tests passed!"); 321 | else 322 | $display("%0d mismatches out of %0d total tests.", mismatch_count, 24); 323 | $finish; 324 | end 325 | 326 | endmodule 327 | -------------------------------------------------------------------------------- /demo_files/AutoChip/ESWEEK/7420_example/7420.sv: -------------------------------------------------------------------------------- 1 | // The 7400-series integrated circuits are a series of digital chips with a few gates each. The 7420 is a chip with two 4-input NAND gates. 2 | 3 | // Create a module with the same functionality as the 7420 chip. It has 8 inputs and 2 outputs. 4 | 5 | module top_module( 6 | input p1a, 7 | input p1b, 8 | input p1c, 9 | input p1d, 10 | output p1y, 11 | input p2a, 12 | input p2b, 13 | input p2c, 14 | input p2d, 15 | output p2y 16 | ); 17 | -------------------------------------------------------------------------------- /demo_files/AutoChip/ESWEEK/7420_example/7420_tb.sv: -------------------------------------------------------------------------------- 1 | `timescale 1 ps/1 ps 2 | `define OK 12 3 | `define INCORRECT 13 4 | module reference_module( 5 | input p1a, 6 | input p1b, 7 | input p1c, 8 | input p1d, 9 | output p1y, 10 | input p2a, 11 | input p2b, 12 | input p2c, 13 | input p2d, 14 | output p2y 15 | ); 16 | 17 | assign p1y = ~&( {p1a, p1b, p1c, p1d} ); 18 | assign p2y = ~&( {p2a, p2b, p2c, p2d} ); 19 | 20 | endmodule 21 | 22 | 23 | module stimulus_gen ( 24 | input clk, 25 | output reg p1a, p1b, p1c, p1d, 26 | output reg p2a, p2b, p2c, p2d, 27 | output reg[511:0] wavedrom_title, 28 | output reg wavedrom_enable 29 | ); 30 | 31 | 32 | // Add two ports to module stimulus_gen: 33 | // output [511:0] wavedrom_title 34 | // output reg wavedrom_enable 35 | 36 | task wavedrom_start(input[511:0] title = ""); 37 | endtask 38 | 39 | task wavedrom_stop; 40 | #1; 41 | endtask 42 | 43 | 44 | 45 | initial begin 46 | int count; count = 0; 47 | {p1a,p1b,p1c,p1d} <= 4'h0; 48 | {p2a,p2b,p2c,p2d} <= 4'h0; 49 | wavedrom_start("Two NAND gates"); 50 | repeat(20) @(posedge clk) begin 51 | {p1a,p1b,p1c,p1d} <= count; 52 | {p2a,p2b,p2c,p2d} <= count+1; 53 | count = count + 1; 54 | end 55 | wavedrom_stop(); 56 | 57 | repeat(200) @(posedge clk,negedge clk) begin 58 | {p1a,p1b,p1c,p1d,p2a,p2b,p2c,p2d} <= $random; 59 | end 60 | 61 | #1 $finish; 62 | end 63 | 64 | endmodule 65 | 66 | module tb(); 67 | 68 | typedef struct packed { 69 | int errors; 70 | int errortime; 71 | int errors_p1y; 72 | int errortime_p1y; 73 | int errors_p2y; 74 | int errortime_p2y; 75 | 76 | int clocks; 77 | } stats; 78 | 79 | stats stats1; 80 | 81 | 82 | wire[511:0] wavedrom_title; 83 | wire wavedrom_enable; 84 | int wavedrom_hide_after_time; 85 | 86 | reg clk=0; 87 | initial forever 88 | #5 clk = ~clk; 89 | 90 | logic p1a; 91 | logic p1b; 92 | logic p1c; 93 | logic p1d; 94 | logic p2a; 95 | logic p2b; 96 | logic p2c; 97 | logic p2d; 98 | logic p1y_ref; 99 | logic p1y_dut; 100 | logic p2y_ref; 101 | logic p2y_dut; 102 | 103 | initial begin 104 | $dumpfile("wave.vcd"); 105 | $dumpvars(1, stim1.clk, tb_mismatch ,p1a,p1b,p1c,p1d,p2a,p2b,p2c,p2d,p1y_ref,p1y_dut,p2y_ref,p2y_dut ); 106 | end 107 | 108 | 109 | wire tb_match; // Verification 110 | wire tb_mismatch = ~tb_match; 111 | 112 | stimulus_gen stim1 ( 113 | .clk, 114 | .* , 115 | .p1a, 116 | .p1b, 117 | .p1c, 118 | .p1d, 119 | .p2a, 120 | .p2b, 121 | .p2c, 122 | .p2d ); 123 | reference_module good1 ( 124 | .p1a, 125 | .p1b, 126 | .p1c, 127 | .p1d, 128 | .p2a, 129 | .p2b, 130 | .p2c, 131 | .p2d, 132 | .p1y(p1y_ref), 133 | .p2y(p2y_ref) ); 134 | 135 | top_module top_module1 ( 136 | .p1a, 137 | .p1b, 138 | .p1c, 139 | .p1d, 140 | .p2a, 141 | .p2b, 142 | .p2c, 143 | .p2d, 144 | .p1y(p1y_dut), 145 | .p2y(p2y_dut) ); 146 | 147 | 148 | bit strobe = 0; 149 | task wait_for_end_of_timestep; 150 | repeat(5) begin 151 | strobe <= !strobe; // Try to delay until the very end of the time step. 152 | @(strobe); 153 | end 154 | endtask 155 | 156 | 157 | final begin 158 | if (stats1.errors_p1y) $display("Hint: Output '%s' has %0d mismatches. First mismatch occurred at time %0d.", "p1y", stats1.errors_p1y, stats1.errortime_p1y); 159 | else $display("Hint: Output '%s' has no mismatches.", "p1y"); 160 | if (stats1.errors_p2y) $display("Hint: Output '%s' has %0d mismatches. First mismatch occurred at time %0d.", "p2y", stats1.errors_p2y, stats1.errortime_p2y); 161 | else $display("Hint: Output '%s' has no mismatches.", "p2y"); 162 | 163 | $display("Hint: Total mismatched samples is %1d out of %1d samples\n", stats1.errors, stats1.clocks); 164 | $display("Simulation finished at %0d ps", $time); 165 | $display("Mismatches: %1d in %1d samples", stats1.errors, stats1.clocks); 166 | end 167 | 168 | // Verification: XORs on the right makes any X in good_vector match anything, but X in dut_vector will only match X. 169 | assign tb_match = ( { p1y_ref, p2y_ref } === ( { p1y_ref, p2y_ref } ^ { p1y_dut, p2y_dut } ^ { p1y_ref, p2y_ref } ) ); 170 | // Use explicit sensitivity list here. @(*) causes NetProc::nex_input() to be called when trying to compute 171 | // the sensitivity list of the @(strobe) process, which isn't implemented. 172 | always @(posedge clk, negedge clk) begin 173 | 174 | stats1.clocks++; 175 | if (!tb_match) begin 176 | if (stats1.errors == 0) stats1.errortime = $time; 177 | stats1.errors++; 178 | end 179 | if (p1y_ref !== ( p1y_ref ^ p1y_dut ^ p1y_ref )) 180 | begin if (stats1.errors_p1y == 0) stats1.errortime_p1y = $time; 181 | stats1.errors_p1y = stats1.errors_p1y+1'b1; end 182 | if (p2y_ref !== ( p2y_ref ^ p2y_dut ^ p2y_ref )) 183 | begin if (stats1.errors_p2y == 0) stats1.errortime_p2y = $time; 184 | stats1.errors_p2y = stats1.errors_p2y+1'b1; end 185 | 186 | end 187 | endmodule 188 | -------------------------------------------------------------------------------- /demo_files/AutoChip/ESWEEK/7420_example/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "general": { 3 | "prompt": "./7420.sv", 4 | "name": "top_module", 5 | "testbench": "./7420_tb.sv", 6 | "model_family": "ChatGPT", 7 | "model_id": "gpt-4o-mini", 8 | "num_candidates": 5, 9 | "iterations": 5, 10 | "outdir": "outputs_7420", 11 | "log": "log.txt", 12 | "ensemble": false 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /demo_files/AutoChip/ESWEEK/arbiter_example/2013_q2afsm.sv: -------------------------------------------------------------------------------- 1 | // Consider the FSM described by the state diagram shown below: 2 | 3 | // A --r1=0,r2=0,r3=0--> A 4 | // A --r1=1--> B 5 | // A --r1=0,r2=1--> C 6 | // A --r1=0,r2=0,r3=0--> D 7 | // B (g1=1) --r1=1--> B 8 | // B (g1=1) --r1=0--> A 9 | // C (g2=1) --r2=1--> C 10 | // C (g2=1) --r2=0--> A 11 | 12 | // Resetn is an active-low synchronous reset that resets into state A. This FSM acts as an arbiter circuit, which controls access to some type of resource by three requesting devices. Each device makes its request for the resource by setting a signal _r[i]_ = 1, where _r[i]_ is either _r[1]_, _r[2]_, or _r[3]_. Each r[i] is an input signal to the FSM, and represents one of the three devices. The FSM stays in state _A_ as long as there are no requests. When one or more request occurs, then the FSM decides which device receives a grant to use the resource and changes to a state that sets that device's _g[i]_ signal to 1. Each _g[i]_ is an output from the FSM. There is a priority system, in that device 1 has a higher priority than device 2, and device 3 has the lowest priority. Hence, for example, device 3 will only receive a grant if it is the only device making a request when the FSM is in state _A_. Once a device, _i_, is given a grant by the FSM, that device continues to receive the grant as long as its request, _r[i]_ = 1. 13 | 14 | // Write complete Verilog code that represents this FSM. Use separate always blocks for the state table and the state flip-flops, as done in lectures. Describe the FSM outputs, _g[i]_, using either continuous assignment statement(s) or an always block (at your discretion). Assign any state codes that you wish to use. 15 | 16 | module top_module ( 17 | input clk, 18 | input resetn, 19 | input [3:1] r, 20 | output [3:1] g 21 | ); 22 | -------------------------------------------------------------------------------- /demo_files/AutoChip/ESWEEK/arbiter_example/2013_q2afsm_tb.sv: -------------------------------------------------------------------------------- 1 | `timescale 1 ps/1 ps 2 | `define OK 12 3 | `define INCORRECT 13 4 | module reference_module ( 5 | input clk, 6 | input resetn, 7 | input [3:1] r, 8 | output [3:1] g 9 | ); 10 | parameter A=0, B=1, C=2, D=3; 11 | reg [1:0] state, next; 12 | 13 | always @(posedge clk) begin 14 | if (~resetn) state <= A; 15 | else state <= next; 16 | end 17 | 18 | always@(state,r) begin 19 | case (state) 20 | A: if (r[1]) next = B; 21 | else if (r[2]) next = C; 22 | else if (r[3]) next = D; 23 | else next = A; 24 | B: next = r[1] ? B : A; 25 | C: next = r[2] ? C : A; 26 | D: next = r[3] ? D : A; 27 | default: next = 'x; 28 | endcase 29 | end 30 | 31 | assign g[1] = (state == B); 32 | assign g[2] = (state == C); 33 | assign g[3] = (state == D); 34 | endmodule 35 | 36 | 37 | module stimulus_gen ( 38 | input clk, 39 | output logic resetn, 40 | output logic [3:1] r, 41 | output reg[511:0] wavedrom_title, 42 | output reg wavedrom_enable, 43 | input tb_match 44 | ); 45 | reg reset; 46 | assign resetn = ~reset; 47 | 48 | task reset_test(input async=0); 49 | bit arfail, srfail, datafail; 50 | 51 | @(posedge clk); 52 | @(posedge clk) reset <= 0; 53 | repeat(3) @(posedge clk); 54 | 55 | @(negedge clk) begin datafail = !tb_match ; reset <= 1; end 56 | @(posedge clk) arfail = !tb_match; 57 | @(posedge clk) begin 58 | srfail = !tb_match; 59 | reset <= 0; 60 | end 61 | if (srfail) 62 | $display("Hint: Your reset doesn't seem to be working."); 63 | else if (arfail && (async || !datafail)) 64 | $display("Hint: Your reset should be %0s, but doesn't appear to be.", async ? "asynchronous" : "synchronous"); 65 | // Don't warn about synchronous reset if the half-cycle before is already wrong. It's more likely 66 | // a functionality error than the reset being implemented asynchronously. 67 | 68 | endtask 69 | 70 | 71 | // Add two ports to module stimulus_gen: 72 | // output [511:0] wavedrom_title 73 | // output reg wavedrom_enable 74 | 75 | task wavedrom_start(input[511:0] title = ""); 76 | endtask 77 | 78 | task wavedrom_stop; 79 | #1; 80 | endtask 81 | 82 | 83 | 84 | initial begin 85 | reset <= 1; 86 | r <= 0; 87 | @(posedge clk); 88 | 89 | r <= 1; 90 | reset_test(); 91 | 92 | r <= 0; 93 | wavedrom_start(""); 94 | @(posedge clk) r <= 0; 95 | @(posedge clk) r <= 7; 96 | @(posedge clk) r <= 7; 97 | @(posedge clk) r <= 7; 98 | @(posedge clk) r <= 6; 99 | @(posedge clk) r <= 6; 100 | @(posedge clk) r <= 6; 101 | @(posedge clk) r <= 4; 102 | @(posedge clk) r <= 4; 103 | @(posedge clk) r <= 4; 104 | @(posedge clk) r <= 0; 105 | @(posedge clk) r <= 0; 106 | @(posedge clk) r <= 4; 107 | @(posedge clk) r <= 6; 108 | @(posedge clk) r <= 7; 109 | @(posedge clk) r <= 7; 110 | @(posedge clk) r <= 7; 111 | @(negedge clk); 112 | wavedrom_stop(); 113 | 114 | @(posedge clk); 115 | reset <= 0; 116 | @(posedge clk); 117 | @(posedge clk); 118 | 119 | repeat(500) @(negedge clk) begin 120 | reset <= ($random & 63) == 0; 121 | r <= $random; 122 | end 123 | 124 | #1 $finish; 125 | end 126 | 127 | endmodule 128 | 129 | module tb(); 130 | 131 | typedef struct packed { 132 | int errors; 133 | int errortime; 134 | int errors_g; 135 | int errortime_g; 136 | 137 | int clocks; 138 | } stats; 139 | 140 | stats stats1; 141 | 142 | 143 | wire[511:0] wavedrom_title; 144 | wire wavedrom_enable; 145 | int wavedrom_hide_after_time; 146 | 147 | reg clk=0; 148 | initial forever 149 | #5 clk = ~clk; 150 | 151 | logic resetn; 152 | logic [3:1] r; 153 | logic [3:1] g_ref; 154 | logic [3:1] g_dut; 155 | 156 | initial begin 157 | $dumpfile("wave.vcd"); 158 | $dumpvars(1, stim1.clk, tb_mismatch ,clk,resetn,r,g_ref,g_dut ); 159 | end 160 | 161 | 162 | wire tb_match; // Verification 163 | wire tb_mismatch = ~tb_match; 164 | 165 | stimulus_gen stim1 ( 166 | .clk, 167 | .* , 168 | .resetn, 169 | .r ); 170 | reference_module good1 ( 171 | .clk, 172 | .resetn, 173 | .r, 174 | .g(g_ref) ); 175 | 176 | top_module top_module1 ( 177 | .clk, 178 | .resetn, 179 | .r, 180 | .g(g_dut) ); 181 | 182 | 183 | bit strobe = 0; 184 | task wait_for_end_of_timestep; 185 | repeat(5) begin 186 | strobe <= !strobe; // Try to delay until the very end of the time step. 187 | @(strobe); 188 | end 189 | endtask 190 | 191 | 192 | final begin 193 | if (stats1.errors_g) $display("Hint: Output '%s' has %0d mismatches. First mismatch occurred at time %0d.", "g", stats1.errors_g, stats1.errortime_g); 194 | else $display("Hint: Output '%s' has no mismatches.", "g"); 195 | 196 | $display("Hint: Total mismatched samples is %1d out of %1d samples\n", stats1.errors, stats1.clocks); 197 | $display("Simulation finished at %0d ps", $time); 198 | $display("Mismatches: %1d in %1d samples", stats1.errors, stats1.clocks); 199 | end 200 | 201 | // Verification: XORs on the right makes any X in good_vector match anything, but X in dut_vector will only match X. 202 | assign tb_match = ( { g_ref } === ( { g_ref } ^ { g_dut } ^ { g_ref } ) ); 203 | // Use explicit sensitivity list here. @(*) causes NetProc::nex_input() to be called when trying to compute 204 | // the sensitivity list of the @(strobe) process, which isn't implemented. 205 | always @(posedge clk, negedge clk) begin 206 | 207 | stats1.clocks++; 208 | if (!tb_match) begin 209 | if (stats1.errors == 0) stats1.errortime = $time; 210 | stats1.errors++; 211 | end 212 | if (g_ref !== ( g_ref ^ g_dut ^ g_ref )) 213 | begin if (stats1.errors_g == 0) stats1.errortime_g = $time; 214 | stats1.errors_g = stats1.errors_g+1'b1; end 215 | 216 | end 217 | endmodule 218 | -------------------------------------------------------------------------------- /demo_files/AutoChip/ESWEEK/arbiter_example/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "general": { 3 | "prompt": "./2013_q2afsm.sv", 4 | "name": "top_module", 5 | "testbench": "./2013_q2afsm_tb.sv", 6 | "model_family": "ChatGPT", 7 | "model_id": "gpt-4o-mini", 8 | "num_candidates": 5, 9 | "iterations": 5, 10 | "outdir": "outputs_arbiter", 11 | "log": "log.txt", 12 | "ensemble": false 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /demo_files/AutoChip/ESWEEK/rule90_example/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "general": { 3 | "prompt": "./rule90.sv", 4 | "name": "top_module", 5 | "testbench": "./rule90_tb.sv", 6 | "model_family": "ChatGPT", 7 | "model_id": "gpt-4o-mini", 8 | "num_candidates": 5, 9 | "iterations": 5, 10 | "outdir": "outputs_rule90", 11 | "log": "log.txt", 12 | "ensemble": false 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /demo_files/AutoChip/ESWEEK/rule90_example/rule90.sv: -------------------------------------------------------------------------------- 1 | // Rule 90 is a one-dimensional cellular automaton with interesting properties. The rules are simple. There is a one-dimensional array of cells (on or off). At each time step, the next state of each cell is the XOR of the cell's two current neighbours: 2 | // Left | Center | Right | Center's next state 3 | // 1 | 1 | 1 | 0 4 | // 1 | 1 | 0 | 1 5 | // 1 | 0 | 1 | 0 6 | // 1 | 0 | 0 | 1 7 | // 0 | 1 | 1 | 1 8 | // 0 | 1 | 0 | 0 9 | // 0 | 0 | 1 | 1 10 | // 0 | 0 | 0 | 0 11 | // In this circuit, create a 512-cell system (q[511:0]), and advance by one time step each clock cycle. The load input indicates the state of the system should be loaded with data[511:0]. Assume the boundaries (q[-1] and q[512]) are both zero (off). 12 | 13 | module top_module( 14 | input clk, 15 | input load, 16 | input [511:0] data, 17 | output reg [511:0] q); 18 | -------------------------------------------------------------------------------- /demo_files/AutoChip/ESWEEK/rule90_example/rule90_tb.sv: -------------------------------------------------------------------------------- 1 | `timescale 1 ps/1 ps 2 | `define OK 12 3 | `define INCORRECT 13 4 | module reference_module( 5 | input clk, 6 | input load, 7 | input [511:0] data, 8 | output reg [511:0] q); 9 | 10 | always @(posedge clk) begin 11 | if (load) 12 | q <= data; 13 | else begin 14 | q <= q[$bits(q)-1:1] ^ {q[$bits(q)-2:0], 1'b0} ; 15 | end 16 | end 17 | endmodule 18 | 19 | 20 | module stimulus_gen ( 21 | input clk, 22 | output reg load, 23 | output reg[511:0] data, 24 | output reg[511:0] wavedrom_title, 25 | output reg wavedrom_enable 26 | ); 27 | 28 | 29 | // Add two ports to module stimulus_gen: 30 | // output [511:0] wavedrom_title 31 | // output reg wavedrom_enable 32 | 33 | task wavedrom_start(input[511:0] title = ""); 34 | endtask 35 | 36 | task wavedrom_stop; 37 | #1; 38 | endtask 39 | 40 | 41 | 42 | initial begin 43 | data <= 0; 44 | data[0] <= 1'b1; 45 | load <= 1; 46 | @(posedge clk); wavedrom_start("Sierpiński triangle: See Hint."); 47 | @(posedge clk); 48 | @(posedge clk); 49 | load <= 0; 50 | repeat(10) @(posedge clk); 51 | wavedrom_stop(); 52 | 53 | 54 | data <= 0; 55 | data[256] <= 1'b1; 56 | load <= 1; 57 | @(posedge clk); 58 | @(posedge clk); 59 | @(posedge clk); 60 | load <= 0; 61 | repeat(1000) @(posedge clk) begin 62 | end 63 | data <= 512'h1000000000000001; 64 | load <= 1; 65 | @(posedge clk); 66 | load <= 0; 67 | repeat(1000) @(posedge clk) begin 68 | end 69 | 70 | data <= $random; 71 | load <= 1; 72 | @(posedge clk); 73 | load <= 0; 74 | repeat(1000) @(posedge clk) begin 75 | end 76 | 77 | data <= 0; 78 | load <= 1; 79 | repeat(20) @(posedge clk); 80 | repeat(2) @(posedge clk) data <= data + 2; 81 | @(posedge clk) begin 82 | load <= 0; 83 | data <= data + 1; 84 | end 85 | repeat(20) @(posedge clk) data <= data + 1; 86 | repeat(500) @(posedge clk) begin 87 | end 88 | 89 | #1 $finish; 90 | end 91 | 92 | endmodule 93 | 94 | module tb(); 95 | 96 | typedef struct packed { 97 | int errors; 98 | int errortime; 99 | int errors_q; 100 | int errortime_q; 101 | 102 | int clocks; 103 | } stats; 104 | 105 | stats stats1; 106 | 107 | 108 | wire[511:0] wavedrom_title; 109 | wire wavedrom_enable; 110 | int wavedrom_hide_after_time; 111 | 112 | reg clk=0; 113 | initial forever 114 | #5 clk = ~clk; 115 | 116 | logic load; 117 | logic [511:0] data; 118 | logic [511:0] q_ref; 119 | logic [511:0] q_dut; 120 | 121 | initial begin 122 | $dumpfile("wave.vcd"); 123 | $dumpvars(1, stim1.clk, tb_mismatch ,clk,load,data,q_ref,q_dut ); 124 | end 125 | 126 | 127 | wire tb_match; // Verification 128 | wire tb_mismatch = ~tb_match; 129 | 130 | stimulus_gen stim1 ( 131 | .clk, 132 | .* , 133 | .load, 134 | .data ); 135 | reference_module good1 ( 136 | .clk, 137 | .load, 138 | .data, 139 | .q(q_ref) ); 140 | 141 | top_module top_module1 ( 142 | .clk, 143 | .load, 144 | .data, 145 | .q(q_dut) ); 146 | 147 | 148 | bit strobe = 0; 149 | task wait_for_end_of_timestep; 150 | repeat(5) begin 151 | strobe <= !strobe; // Try to delay until the very end of the time step. 152 | @(strobe); 153 | end 154 | endtask 155 | 156 | 157 | final begin 158 | if (stats1.errors_q) $display("Hint: Output '%s' has %0d mismatches. First mismatch occurred at time %0d.", "q", stats1.errors_q, stats1.errortime_q); 159 | else $display("Hint: Output '%s' has no mismatches.", "q"); 160 | 161 | $display("Hint: Total mismatched samples is %1d out of %1d samples\n", stats1.errors, stats1.clocks); 162 | $display("Simulation finished at %0d ps", $time); 163 | $display("Mismatches: %1d in %1d samples", stats1.errors, stats1.clocks); 164 | end 165 | 166 | // Verification: XORs on the right makes any X in good_vector match anything, but X in dut_vector will only match X. 167 | assign tb_match = ( { q_ref } === ( { q_ref } ^ { q_dut } ^ { q_ref } ) ); 168 | // Use explicit sensitivity list here. @(*) causes NetProc::nex_input() to be called when trying to compute 169 | // the sensitivity list of the @(strobe) process, which isn't implemented. 170 | always @(posedge clk, negedge clk) begin 171 | 172 | stats1.clocks++; 173 | if (!tb_match) begin 174 | if (stats1.errors == 0) stats1.errortime = $time; 175 | stats1.errors++; 176 | end 177 | if (q_ref !== ( q_ref ^ q_dut ^ q_ref )) 178 | begin if (stats1.errors_q == 0) stats1.errortime_q = $time; 179 | stats1.errors_q = stats1.errors_q+1'b1; end 180 | 181 | end 182 | endmodule 183 | -------------------------------------------------------------------------------- /demo_files/AutoChip/ETS/7420_example/7420.sv: -------------------------------------------------------------------------------- 1 | // The 7400-series integrated circuits are a series of digital chips with a few gates each. The 7420 is a chip with two 4-input NAND gates. 2 | 3 | // Create a module with the same functionality as the 7420 chip. It has 8 inputs and 2 outputs. 4 | 5 | module top_module( 6 | input p1a, 7 | input p1b, 8 | input p1c, 9 | input p1d, 10 | output p1y, 11 | input p2a, 12 | input p2b, 13 | input p2c, 14 | input p2d, 15 | output p2y 16 | ); 17 | -------------------------------------------------------------------------------- /demo_files/AutoChip/ETS/7420_example/7420_tb.sv: -------------------------------------------------------------------------------- 1 | `timescale 1 ps/1 ps 2 | `define OK 12 3 | `define INCORRECT 13 4 | module reference_module( 5 | input p1a, 6 | input p1b, 7 | input p1c, 8 | input p1d, 9 | output p1y, 10 | input p2a, 11 | input p2b, 12 | input p2c, 13 | input p2d, 14 | output p2y 15 | ); 16 | 17 | assign p1y = ~&( {p1a, p1b, p1c, p1d} ); 18 | assign p2y = ~&( {p2a, p2b, p2c, p2d} ); 19 | 20 | endmodule 21 | 22 | 23 | module stimulus_gen ( 24 | input clk, 25 | output reg p1a, p1b, p1c, p1d, 26 | output reg p2a, p2b, p2c, p2d, 27 | output reg[511:0] wavedrom_title, 28 | output reg wavedrom_enable 29 | ); 30 | 31 | 32 | // Add two ports to module stimulus_gen: 33 | // output [511:0] wavedrom_title 34 | // output reg wavedrom_enable 35 | 36 | task wavedrom_start(input[511:0] title = ""); 37 | endtask 38 | 39 | task wavedrom_stop; 40 | #1; 41 | endtask 42 | 43 | 44 | 45 | initial begin 46 | int count; count = 0; 47 | {p1a,p1b,p1c,p1d} <= 4'h0; 48 | {p2a,p2b,p2c,p2d} <= 4'h0; 49 | wavedrom_start("Two NAND gates"); 50 | repeat(20) @(posedge clk) begin 51 | {p1a,p1b,p1c,p1d} <= count; 52 | {p2a,p2b,p2c,p2d} <= count+1; 53 | count = count + 1; 54 | end 55 | wavedrom_stop(); 56 | 57 | repeat(200) @(posedge clk,negedge clk) begin 58 | {p1a,p1b,p1c,p1d,p2a,p2b,p2c,p2d} <= $random; 59 | end 60 | 61 | #1 $finish; 62 | end 63 | 64 | endmodule 65 | 66 | module tb(); 67 | 68 | typedef struct packed { 69 | int errors; 70 | int errortime; 71 | int errors_p1y; 72 | int errortime_p1y; 73 | int errors_p2y; 74 | int errortime_p2y; 75 | 76 | int clocks; 77 | } stats; 78 | 79 | stats stats1; 80 | 81 | 82 | wire[511:0] wavedrom_title; 83 | wire wavedrom_enable; 84 | int wavedrom_hide_after_time; 85 | 86 | reg clk=0; 87 | initial forever 88 | #5 clk = ~clk; 89 | 90 | logic p1a; 91 | logic p1b; 92 | logic p1c; 93 | logic p1d; 94 | logic p2a; 95 | logic p2b; 96 | logic p2c; 97 | logic p2d; 98 | logic p1y_ref; 99 | logic p1y_dut; 100 | logic p2y_ref; 101 | logic p2y_dut; 102 | 103 | initial begin 104 | $dumpfile("wave.vcd"); 105 | $dumpvars(1, stim1.clk, tb_mismatch ,p1a,p1b,p1c,p1d,p2a,p2b,p2c,p2d,p1y_ref,p1y_dut,p2y_ref,p2y_dut ); 106 | end 107 | 108 | 109 | wire tb_match; // Verification 110 | wire tb_mismatch = ~tb_match; 111 | 112 | stimulus_gen stim1 ( 113 | .clk, 114 | .* , 115 | .p1a, 116 | .p1b, 117 | .p1c, 118 | .p1d, 119 | .p2a, 120 | .p2b, 121 | .p2c, 122 | .p2d ); 123 | reference_module good1 ( 124 | .p1a, 125 | .p1b, 126 | .p1c, 127 | .p1d, 128 | .p2a, 129 | .p2b, 130 | .p2c, 131 | .p2d, 132 | .p1y(p1y_ref), 133 | .p2y(p2y_ref) ); 134 | 135 | top_module top_module1 ( 136 | .p1a, 137 | .p1b, 138 | .p1c, 139 | .p1d, 140 | .p2a, 141 | .p2b, 142 | .p2c, 143 | .p2d, 144 | .p1y(p1y_dut), 145 | .p2y(p2y_dut) ); 146 | 147 | 148 | bit strobe = 0; 149 | task wait_for_end_of_timestep; 150 | repeat(5) begin 151 | strobe <= !strobe; // Try to delay until the very end of the time step. 152 | @(strobe); 153 | end 154 | endtask 155 | 156 | 157 | final begin 158 | if (stats1.errors_p1y) $display("Hint: Output '%s' has %0d mismatches. First mismatch occurred at time %0d.", "p1y", stats1.errors_p1y, stats1.errortime_p1y); 159 | else $display("Hint: Output '%s' has no mismatches.", "p1y"); 160 | if (stats1.errors_p2y) $display("Hint: Output '%s' has %0d mismatches. First mismatch occurred at time %0d.", "p2y", stats1.errors_p2y, stats1.errortime_p2y); 161 | else $display("Hint: Output '%s' has no mismatches.", "p2y"); 162 | 163 | $display("Hint: Total mismatched samples is %1d out of %1d samples\n", stats1.errors, stats1.clocks); 164 | $display("Simulation finished at %0d ps", $time); 165 | $display("Mismatches: %1d in %1d samples", stats1.errors, stats1.clocks); 166 | end 167 | 168 | // Verification: XORs on the right makes any X in good_vector match anything, but X in dut_vector will only match X. 169 | assign tb_match = ( { p1y_ref, p2y_ref } === ( { p1y_ref, p2y_ref } ^ { p1y_dut, p2y_dut } ^ { p1y_ref, p2y_ref } ) ); 170 | // Use explicit sensitivity list here. @(*) causes NetProc::nex_input() to be called when trying to compute 171 | // the sensitivity list of the @(strobe) process, which isn't implemented. 172 | always @(posedge clk, negedge clk) begin 173 | 174 | stats1.clocks++; 175 | if (!tb_match) begin 176 | if (stats1.errors == 0) stats1.errortime = $time; 177 | stats1.errors++; 178 | end 179 | if (p1y_ref !== ( p1y_ref ^ p1y_dut ^ p1y_ref )) 180 | begin if (stats1.errors_p1y == 0) stats1.errortime_p1y = $time; 181 | stats1.errors_p1y = stats1.errors_p1y+1'b1; end 182 | if (p2y_ref !== ( p2y_ref ^ p2y_dut ^ p2y_ref )) 183 | begin if (stats1.errors_p2y == 0) stats1.errortime_p2y = $time; 184 | stats1.errors_p2y = stats1.errors_p2y+1'b1; end 185 | 186 | end 187 | endmodule 188 | -------------------------------------------------------------------------------- /demo_files/AutoChip/ETS/7420_example/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "general": { 3 | "prompt": "./7420.sv", 4 | "name": "top_module", 5 | "testbench": "./7420_tb.sv", 6 | "model_family": "ChatGPT", 7 | "model_id": "gpt-4o-mini", 8 | "num_candidates": 5, 9 | "iterations": 5, 10 | "outdir": "outputs_7420", 11 | "log": "log.txt", 12 | "ensemble": false 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /demo_files/AutoChip/ETS/arbiter_example/2013_q2afsm.sv: -------------------------------------------------------------------------------- 1 | // Consider the FSM described by the state diagram shown below: 2 | 3 | // A --r1=0,r2=0,r3=0--> A 4 | // A --r1=1--> B 5 | // A --r1=0,r2=1--> C 6 | // A --r1=0,r2=0,r3=0--> D 7 | // B (g1=1) --r1=1--> B 8 | // B (g1=1) --r1=0--> A 9 | // C (g2=1) --r2=1--> C 10 | // C (g2=1) --r2=0--> A 11 | 12 | // Resetn is an active-low synchronous reset that resets into state A. This FSM acts as an arbiter circuit, which controls access to some type of resource by three requesting devices. Each device makes its request for the resource by setting a signal _r[i]_ = 1, where _r[i]_ is either _r[1]_, _r[2]_, or _r[3]_. Each r[i] is an input signal to the FSM, and represents one of the three devices. The FSM stays in state _A_ as long as there are no requests. When one or more request occurs, then the FSM decides which device receives a grant to use the resource and changes to a state that sets that device's _g[i]_ signal to 1. Each _g[i]_ is an output from the FSM. There is a priority system, in that device 1 has a higher priority than device 2, and device 3 has the lowest priority. Hence, for example, device 3 will only receive a grant if it is the only device making a request when the FSM is in state _A_. Once a device, _i_, is given a grant by the FSM, that device continues to receive the grant as long as its request, _r[i]_ = 1. 13 | 14 | // Write complete Verilog code that represents this FSM. Use separate always blocks for the state table and the state flip-flops, as done in lectures. Describe the FSM outputs, _g[i]_, using either continuous assignment statement(s) or an always block (at your discretion). Assign any state codes that you wish to use. 15 | 16 | module top_module ( 17 | input clk, 18 | input resetn, 19 | input [3:1] r, 20 | output [3:1] g 21 | ); 22 | -------------------------------------------------------------------------------- /demo_files/AutoChip/ETS/arbiter_example/2013_q2afsm_tb.sv: -------------------------------------------------------------------------------- 1 | `timescale 1 ps/1 ps 2 | `define OK 12 3 | `define INCORRECT 13 4 | module reference_module ( 5 | input clk, 6 | input resetn, 7 | input [3:1] r, 8 | output [3:1] g 9 | ); 10 | parameter A=0, B=1, C=2, D=3; 11 | reg [1:0] state, next; 12 | 13 | always @(posedge clk) begin 14 | if (~resetn) state <= A; 15 | else state <= next; 16 | end 17 | 18 | always@(state,r) begin 19 | case (state) 20 | A: if (r[1]) next = B; 21 | else if (r[2]) next = C; 22 | else if (r[3]) next = D; 23 | else next = A; 24 | B: next = r[1] ? B : A; 25 | C: next = r[2] ? C : A; 26 | D: next = r[3] ? D : A; 27 | default: next = 'x; 28 | endcase 29 | end 30 | 31 | assign g[1] = (state == B); 32 | assign g[2] = (state == C); 33 | assign g[3] = (state == D); 34 | endmodule 35 | 36 | 37 | module stimulus_gen ( 38 | input clk, 39 | output logic resetn, 40 | output logic [3:1] r, 41 | output reg[511:0] wavedrom_title, 42 | output reg wavedrom_enable, 43 | input tb_match 44 | ); 45 | reg reset; 46 | assign resetn = ~reset; 47 | 48 | task reset_test(input async=0); 49 | bit arfail, srfail, datafail; 50 | 51 | @(posedge clk); 52 | @(posedge clk) reset <= 0; 53 | repeat(3) @(posedge clk); 54 | 55 | @(negedge clk) begin datafail = !tb_match ; reset <= 1; end 56 | @(posedge clk) arfail = !tb_match; 57 | @(posedge clk) begin 58 | srfail = !tb_match; 59 | reset <= 0; 60 | end 61 | if (srfail) 62 | $display("Hint: Your reset doesn't seem to be working."); 63 | else if (arfail && (async || !datafail)) 64 | $display("Hint: Your reset should be %0s, but doesn't appear to be.", async ? "asynchronous" : "synchronous"); 65 | // Don't warn about synchronous reset if the half-cycle before is already wrong. It's more likely 66 | // a functionality error than the reset being implemented asynchronously. 67 | 68 | endtask 69 | 70 | 71 | // Add two ports to module stimulus_gen: 72 | // output [511:0] wavedrom_title 73 | // output reg wavedrom_enable 74 | 75 | task wavedrom_start(input[511:0] title = ""); 76 | endtask 77 | 78 | task wavedrom_stop; 79 | #1; 80 | endtask 81 | 82 | 83 | 84 | initial begin 85 | reset <= 1; 86 | r <= 0; 87 | @(posedge clk); 88 | 89 | r <= 1; 90 | reset_test(); 91 | 92 | r <= 0; 93 | wavedrom_start(""); 94 | @(posedge clk) r <= 0; 95 | @(posedge clk) r <= 7; 96 | @(posedge clk) r <= 7; 97 | @(posedge clk) r <= 7; 98 | @(posedge clk) r <= 6; 99 | @(posedge clk) r <= 6; 100 | @(posedge clk) r <= 6; 101 | @(posedge clk) r <= 4; 102 | @(posedge clk) r <= 4; 103 | @(posedge clk) r <= 4; 104 | @(posedge clk) r <= 0; 105 | @(posedge clk) r <= 0; 106 | @(posedge clk) r <= 4; 107 | @(posedge clk) r <= 6; 108 | @(posedge clk) r <= 7; 109 | @(posedge clk) r <= 7; 110 | @(posedge clk) r <= 7; 111 | @(negedge clk); 112 | wavedrom_stop(); 113 | 114 | @(posedge clk); 115 | reset <= 0; 116 | @(posedge clk); 117 | @(posedge clk); 118 | 119 | repeat(500) @(negedge clk) begin 120 | reset <= ($random & 63) == 0; 121 | r <= $random; 122 | end 123 | 124 | #1 $finish; 125 | end 126 | 127 | endmodule 128 | 129 | module tb(); 130 | 131 | typedef struct packed { 132 | int errors; 133 | int errortime; 134 | int errors_g; 135 | int errortime_g; 136 | 137 | int clocks; 138 | } stats; 139 | 140 | stats stats1; 141 | 142 | 143 | wire[511:0] wavedrom_title; 144 | wire wavedrom_enable; 145 | int wavedrom_hide_after_time; 146 | 147 | reg clk=0; 148 | initial forever 149 | #5 clk = ~clk; 150 | 151 | logic resetn; 152 | logic [3:1] r; 153 | logic [3:1] g_ref; 154 | logic [3:1] g_dut; 155 | 156 | initial begin 157 | $dumpfile("wave.vcd"); 158 | $dumpvars(1, stim1.clk, tb_mismatch ,clk,resetn,r,g_ref,g_dut ); 159 | end 160 | 161 | 162 | wire tb_match; // Verification 163 | wire tb_mismatch = ~tb_match; 164 | 165 | stimulus_gen stim1 ( 166 | .clk, 167 | .* , 168 | .resetn, 169 | .r ); 170 | reference_module good1 ( 171 | .clk, 172 | .resetn, 173 | .r, 174 | .g(g_ref) ); 175 | 176 | top_module top_module1 ( 177 | .clk, 178 | .resetn, 179 | .r, 180 | .g(g_dut) ); 181 | 182 | 183 | bit strobe = 0; 184 | task wait_for_end_of_timestep; 185 | repeat(5) begin 186 | strobe <= !strobe; // Try to delay until the very end of the time step. 187 | @(strobe); 188 | end 189 | endtask 190 | 191 | 192 | final begin 193 | if (stats1.errors_g) $display("Hint: Output '%s' has %0d mismatches. First mismatch occurred at time %0d.", "g", stats1.errors_g, stats1.errortime_g); 194 | else $display("Hint: Output '%s' has no mismatches.", "g"); 195 | 196 | $display("Hint: Total mismatched samples is %1d out of %1d samples\n", stats1.errors, stats1.clocks); 197 | $display("Simulation finished at %0d ps", $time); 198 | $display("Mismatches: %1d in %1d samples", stats1.errors, stats1.clocks); 199 | end 200 | 201 | // Verification: XORs on the right makes any X in good_vector match anything, but X in dut_vector will only match X. 202 | assign tb_match = ( { g_ref } === ( { g_ref } ^ { g_dut } ^ { g_ref } ) ); 203 | // Use explicit sensitivity list here. @(*) causes NetProc::nex_input() to be called when trying to compute 204 | // the sensitivity list of the @(strobe) process, which isn't implemented. 205 | always @(posedge clk, negedge clk) begin 206 | 207 | stats1.clocks++; 208 | if (!tb_match) begin 209 | if (stats1.errors == 0) stats1.errortime = $time; 210 | stats1.errors++; 211 | end 212 | if (g_ref !== ( g_ref ^ g_dut ^ g_ref )) 213 | begin if (stats1.errors_g == 0) stats1.errortime_g = $time; 214 | stats1.errors_g = stats1.errors_g+1'b1; end 215 | 216 | end 217 | endmodule 218 | -------------------------------------------------------------------------------- /demo_files/AutoChip/ETS/arbiter_example/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "general": { 3 | "prompt": "./2013_q2afsm.sv", 4 | "name": "top_module", 5 | "testbench": "./2013_q2afsm_tb.sv", 6 | "model_family": "ChatGPT", 7 | "model_id": "gpt-4o-mini", 8 | "num_candidates": 5, 9 | "iterations": 5, 10 | "outdir": "outputs_arbiter", 11 | "log": "log.txt", 12 | "ensemble": false 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /demo_files/AutoChip/ETS/rule90_example/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "general": { 3 | "prompt": "./rule90.sv", 4 | "name": "top_module", 5 | "testbench": "./rule90_tb.sv", 6 | "model_family": "ChatGPT", 7 | "model_id": "gpt-4o-mini", 8 | "num_candidates": 5, 9 | "iterations": 5, 10 | "outdir": "outputs_rule90", 11 | "log": "log.txt", 12 | "ensemble": false 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /demo_files/AutoChip/ETS/rule90_example/rule90.sv: -------------------------------------------------------------------------------- 1 | // Rule 90 is a one-dimensional cellular automaton with interesting properties. The rules are simple. There is a one-dimensional array of cells (on or off). At each time step, the next state of each cell is the XOR of the cell's two current neighbours: 2 | // Left | Center | Right | Center's next state 3 | // 1 | 1 | 1 | 0 4 | // 1 | 1 | 0 | 1 5 | // 1 | 0 | 1 | 0 6 | // 1 | 0 | 0 | 1 7 | // 0 | 1 | 1 | 1 8 | // 0 | 1 | 0 | 0 9 | // 0 | 0 | 1 | 1 10 | // 0 | 0 | 0 | 0 11 | // In this circuit, create a 512-cell system (q[511:0]), and advance by one time step each clock cycle. The load input indicates the state of the system should be loaded with data[511:0]. Assume the boundaries (q[-1] and q[512]) are both zero (off). 12 | 13 | module top_module( 14 | input clk, 15 | input load, 16 | input [511:0] data, 17 | output reg [511:0] q); 18 | -------------------------------------------------------------------------------- /demo_files/AutoChip/ETS/rule90_example/rule90_tb.sv: -------------------------------------------------------------------------------- 1 | `timescale 1 ps/1 ps 2 | `define OK 12 3 | `define INCORRECT 13 4 | module reference_module( 5 | input clk, 6 | input load, 7 | input [511:0] data, 8 | output reg [511:0] q); 9 | 10 | always @(posedge clk) begin 11 | if (load) 12 | q <= data; 13 | else begin 14 | q <= q[$bits(q)-1:1] ^ {q[$bits(q)-2:0], 1'b0} ; 15 | end 16 | end 17 | endmodule 18 | 19 | 20 | module stimulus_gen ( 21 | input clk, 22 | output reg load, 23 | output reg[511:0] data, 24 | output reg[511:0] wavedrom_title, 25 | output reg wavedrom_enable 26 | ); 27 | 28 | 29 | // Add two ports to module stimulus_gen: 30 | // output [511:0] wavedrom_title 31 | // output reg wavedrom_enable 32 | 33 | task wavedrom_start(input[511:0] title = ""); 34 | endtask 35 | 36 | task wavedrom_stop; 37 | #1; 38 | endtask 39 | 40 | 41 | 42 | initial begin 43 | data <= 0; 44 | data[0] <= 1'b1; 45 | load <= 1; 46 | @(posedge clk); wavedrom_start("Sierpiński triangle: See Hint."); 47 | @(posedge clk); 48 | @(posedge clk); 49 | load <= 0; 50 | repeat(10) @(posedge clk); 51 | wavedrom_stop(); 52 | 53 | 54 | data <= 0; 55 | data[256] <= 1'b1; 56 | load <= 1; 57 | @(posedge clk); 58 | @(posedge clk); 59 | @(posedge clk); 60 | load <= 0; 61 | repeat(1000) @(posedge clk) begin 62 | end 63 | data <= 512'h1000000000000001; 64 | load <= 1; 65 | @(posedge clk); 66 | load <= 0; 67 | repeat(1000) @(posedge clk) begin 68 | end 69 | 70 | data <= $random; 71 | load <= 1; 72 | @(posedge clk); 73 | load <= 0; 74 | repeat(1000) @(posedge clk) begin 75 | end 76 | 77 | data <= 0; 78 | load <= 1; 79 | repeat(20) @(posedge clk); 80 | repeat(2) @(posedge clk) data <= data + 2; 81 | @(posedge clk) begin 82 | load <= 0; 83 | data <= data + 1; 84 | end 85 | repeat(20) @(posedge clk) data <= data + 1; 86 | repeat(500) @(posedge clk) begin 87 | end 88 | 89 | #1 $finish; 90 | end 91 | 92 | endmodule 93 | 94 | module tb(); 95 | 96 | typedef struct packed { 97 | int errors; 98 | int errortime; 99 | int errors_q; 100 | int errortime_q; 101 | 102 | int clocks; 103 | } stats; 104 | 105 | stats stats1; 106 | 107 | 108 | wire[511:0] wavedrom_title; 109 | wire wavedrom_enable; 110 | int wavedrom_hide_after_time; 111 | 112 | reg clk=0; 113 | initial forever 114 | #5 clk = ~clk; 115 | 116 | logic load; 117 | logic [511:0] data; 118 | logic [511:0] q_ref; 119 | logic [511:0] q_dut; 120 | 121 | initial begin 122 | $dumpfile("wave.vcd"); 123 | $dumpvars(1, stim1.clk, tb_mismatch ,clk,load,data,q_ref,q_dut ); 124 | end 125 | 126 | 127 | wire tb_match; // Verification 128 | wire tb_mismatch = ~tb_match; 129 | 130 | stimulus_gen stim1 ( 131 | .clk, 132 | .* , 133 | .load, 134 | .data ); 135 | reference_module good1 ( 136 | .clk, 137 | .load, 138 | .data, 139 | .q(q_ref) ); 140 | 141 | top_module top_module1 ( 142 | .clk, 143 | .load, 144 | .data, 145 | .q(q_dut) ); 146 | 147 | 148 | bit strobe = 0; 149 | task wait_for_end_of_timestep; 150 | repeat(5) begin 151 | strobe <= !strobe; // Try to delay until the very end of the time step. 152 | @(strobe); 153 | end 154 | endtask 155 | 156 | 157 | final begin 158 | if (stats1.errors_q) $display("Hint: Output '%s' has %0d mismatches. First mismatch occurred at time %0d.", "q", stats1.errors_q, stats1.errortime_q); 159 | else $display("Hint: Output '%s' has no mismatches.", "q"); 160 | 161 | $display("Hint: Total mismatched samples is %1d out of %1d samples\n", stats1.errors, stats1.clocks); 162 | $display("Simulation finished at %0d ps", $time); 163 | $display("Mismatches: %1d in %1d samples", stats1.errors, stats1.clocks); 164 | end 165 | 166 | // Verification: XORs on the right makes any X in good_vector match anything, but X in dut_vector will only match X. 167 | assign tb_match = ( { q_ref } === ( { q_ref } ^ { q_dut } ^ { q_ref } ) ); 168 | // Use explicit sensitivity list here. @(*) causes NetProc::nex_input() to be called when trying to compute 169 | // the sensitivity list of the @(strobe) process, which isn't implemented. 170 | always @(posedge clk, negedge clk) begin 171 | 172 | stats1.clocks++; 173 | if (!tb_match) begin 174 | if (stats1.errors == 0) stats1.errortime = $time; 175 | stats1.errors++; 176 | end 177 | if (q_ref !== ( q_ref ^ q_dut ^ q_ref )) 178 | begin if (stats1.errors_q == 0) stats1.errortime_q = $time; 179 | stats1.errors_q = stats1.errors_q+1'b1; end 180 | 181 | end 182 | endmodule 183 | -------------------------------------------------------------------------------- /demo_files/AutoChip/TSS/7420_0_tb.v: -------------------------------------------------------------------------------- 1 | `timescale 1 ns/10 ps // time-unit = 1 ns, precision = 10 ps 2 | 3 | module top_module_tb; 4 | 5 | // duration for each bit = 20 * timescale = 20 * 1 ns = 20ns 6 | localparam period = 20; 7 | 8 | reg p1a; 9 | reg p1b; 10 | reg p1c; 11 | reg p1d; 12 | reg p2a; 13 | reg p2b; 14 | reg p2c; 15 | reg p2d; 16 | 17 | wire p1y; 18 | wire p2y; 19 | 20 | 21 | integer mismatch_count; 22 | 23 | top_module UUT (.p1a(p1a), .p1b(p1b), .p1c(p1c), .p1d(p1d), .p2a(p2a), .p2b(p2b), .p2c(p2c), .p2d(p2d), .p1y(p1y), .p2y(p2y)); 24 | 25 | initial begin 26 | mismatch_count = 0; 27 | 28 | // Tick 0: Inputs = 1'b0, 1'b0, 1'b0, 1'b0, 1'b0, 1'b0, 1'b0, 1'b0, Generated = p1y, p2y, Reference = 1'b1, 1'b1 29 | p1a = 1'b0; p1b = 1'b0; p1c = 1'b0; p1d = 1'b0; p2a = 1'b0; p2b = 1'b0; p2c = 1'b0; p2d = 1'b0; // Set input values 30 | #period; 31 | if (!(p1y === 1'b1 && p2y === 1'b1)) begin 32 | $display("Mismatch at index 0: Inputs = [%b, %b, %b, %b, %b, %b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 1'b0, 1'b0, 1'b0, 1'b0, 1'b0, 1'b0, 1'b0, 1'b0, p1y, p2y, 1'b1, 1'b1); 33 | mismatch_count = mismatch_count + 1; 34 | end 35 | 36 | else begin 37 | $display("Test 0 passed!"); 38 | end 39 | 40 | // Tick 1: Inputs = 1'b0, 1'b0, 1'b0, 1'b0, 1'b0, 1'b0, 1'b0, 1'b1, Generated = p1y, p2y, Reference = 1'b1, 1'b1 41 | p1a = 1'b0; p1b = 1'b0; p1c = 1'b0; p1d = 1'b0; p2a = 1'b0; p2b = 1'b0; p2c = 1'b0; p2d = 1'b1; // Set input values 42 | #period; 43 | if (!(p1y === 1'b1 && p2y === 1'b1)) begin 44 | $display("Mismatch at index 1: Inputs = [%b, %b, %b, %b, %b, %b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 1'b0, 1'b0, 1'b0, 1'b0, 1'b0, 1'b0, 1'b0, 1'b1, p1y, p2y, 1'b1, 1'b1); 45 | mismatch_count = mismatch_count + 1; 46 | end 47 | 48 | else begin 49 | $display("Test 1 passed!"); 50 | end 51 | 52 | // Tick 2: Inputs = 1'b0, 1'b0, 1'b0, 1'b0, 1'b0, 1'b0, 1'b0, 1'b1, Generated = p1y, p2y, Reference = 1'b1, 1'b1 53 | p1a = 1'b0; p1b = 1'b0; p1c = 1'b0; p1d = 1'b0; p2a = 1'b0; p2b = 1'b0; p2c = 1'b0; p2d = 1'b1; // Set input values 54 | #period; 55 | if (!(p1y === 1'b1 && p2y === 1'b1)) begin 56 | $display("Mismatch at index 2: Inputs = [%b, %b, %b, %b, %b, %b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 1'b0, 1'b0, 1'b0, 1'b0, 1'b0, 1'b0, 1'b0, 1'b1, p1y, p2y, 1'b1, 1'b1); 57 | mismatch_count = mismatch_count + 1; 58 | end 59 | 60 | else begin 61 | $display("Test 2 passed!"); 62 | end 63 | 64 | // Tick 3: Inputs = 1'b0, 1'b0, 1'b0, 1'b1, 1'b0, 1'b0, 1'b1, 1'b0, Generated = p1y, p2y, Reference = 1'b1, 1'b1 65 | p1a = 1'b0; p1b = 1'b0; p1c = 1'b0; p1d = 1'b1; p2a = 1'b0; p2b = 1'b0; p2c = 1'b1; p2d = 1'b0; // Set input values 66 | #period; 67 | if (!(p1y === 1'b1 && p2y === 1'b1)) begin 68 | $display("Mismatch at index 3: Inputs = [%b, %b, %b, %b, %b, %b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 1'b0, 1'b0, 1'b0, 1'b1, 1'b0, 1'b0, 1'b1, 1'b0, p1y, p2y, 1'b1, 1'b1); 69 | mismatch_count = mismatch_count + 1; 70 | end 71 | 72 | else begin 73 | $display("Test 3 passed!"); 74 | end 75 | 76 | // Tick 4: Inputs = 1'b0, 1'b0, 1'b0, 1'b1, 1'b0, 1'b0, 1'b1, 1'b0, Generated = p1y, p2y, Reference = 1'b1, 1'b1 77 | p1a = 1'b0; p1b = 1'b0; p1c = 1'b0; p1d = 1'b1; p2a = 1'b0; p2b = 1'b0; p2c = 1'b1; p2d = 1'b0; // Set input values 78 | #period; 79 | if (!(p1y === 1'b1 && p2y === 1'b1)) begin 80 | $display("Mismatch at index 4: Inputs = [%b, %b, %b, %b, %b, %b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 1'b0, 1'b0, 1'b0, 1'b1, 1'b0, 1'b0, 1'b1, 1'b0, p1y, p2y, 1'b1, 1'b1); 81 | mismatch_count = mismatch_count + 1; 82 | end 83 | 84 | else begin 85 | $display("Test 4 passed!"); 86 | end 87 | 88 | // Tick 5: Inputs = 1'b0, 1'b0, 1'b1, 1'b0, 1'b0, 1'b0, 1'b1, 1'b1, Generated = p1y, p2y, Reference = 1'b1, 1'b1 89 | p1a = 1'b0; p1b = 1'b0; p1c = 1'b1; p1d = 1'b0; p2a = 1'b0; p2b = 1'b0; p2c = 1'b1; p2d = 1'b1; // Set input values 90 | #period; 91 | if (!(p1y === 1'b1 && p2y === 1'b1)) begin 92 | $display("Mismatch at index 5: Inputs = [%b, %b, %b, %b, %b, %b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 1'b0, 1'b0, 1'b1, 1'b0, 1'b0, 1'b0, 1'b1, 1'b1, p1y, p2y, 1'b1, 1'b1); 93 | mismatch_count = mismatch_count + 1; 94 | end 95 | 96 | else begin 97 | $display("Test 5 passed!"); 98 | end 99 | 100 | // Tick 6: Inputs = 1'b0, 1'b0, 1'b1, 1'b0, 1'b0, 1'b0, 1'b1, 1'b1, Generated = p1y, p2y, Reference = 1'b1, 1'b1 101 | p1a = 1'b0; p1b = 1'b0; p1c = 1'b1; p1d = 1'b0; p2a = 1'b0; p2b = 1'b0; p2c = 1'b1; p2d = 1'b1; // Set input values 102 | #period; 103 | if (!(p1y === 1'b1 && p2y === 1'b1)) begin 104 | $display("Mismatch at index 6: Inputs = [%b, %b, %b, %b, %b, %b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 1'b0, 1'b0, 1'b1, 1'b0, 1'b0, 1'b0, 1'b1, 1'b1, p1y, p2y, 1'b1, 1'b1); 105 | mismatch_count = mismatch_count + 1; 106 | end 107 | 108 | else begin 109 | $display("Test 6 passed!"); 110 | end 111 | 112 | // Tick 7: Inputs = 1'b0, 1'b0, 1'b1, 1'b1, 1'b0, 1'b1, 1'b0, 1'b0, Generated = p1y, p2y, Reference = 1'b1, 1'b1 113 | p1a = 1'b0; p1b = 1'b0; p1c = 1'b1; p1d = 1'b1; p2a = 1'b0; p2b = 1'b1; p2c = 1'b0; p2d = 1'b0; // Set input values 114 | #period; 115 | if (!(p1y === 1'b1 && p2y === 1'b1)) begin 116 | $display("Mismatch at index 7: Inputs = [%b, %b, %b, %b, %b, %b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 1'b0, 1'b0, 1'b1, 1'b1, 1'b0, 1'b1, 1'b0, 1'b0, p1y, p2y, 1'b1, 1'b1); 117 | mismatch_count = mismatch_count + 1; 118 | end 119 | 120 | else begin 121 | $display("Test 7 passed!"); 122 | end 123 | 124 | // Tick 8: Inputs = 1'b0, 1'b0, 1'b1, 1'b1, 1'b0, 1'b1, 1'b0, 1'b0, Generated = p1y, p2y, Reference = 1'b1, 1'b1 125 | p1a = 1'b0; p1b = 1'b0; p1c = 1'b1; p1d = 1'b1; p2a = 1'b0; p2b = 1'b1; p2c = 1'b0; p2d = 1'b0; // Set input values 126 | #period; 127 | if (!(p1y === 1'b1 && p2y === 1'b1)) begin 128 | $display("Mismatch at index 8: Inputs = [%b, %b, %b, %b, %b, %b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 1'b0, 1'b0, 1'b1, 1'b1, 1'b0, 1'b1, 1'b0, 1'b0, p1y, p2y, 1'b1, 1'b1); 129 | mismatch_count = mismatch_count + 1; 130 | end 131 | 132 | else begin 133 | $display("Test 8 passed!"); 134 | end 135 | 136 | // Tick 9: Inputs = 1'b0, 1'b1, 1'b0, 1'b0, 1'b0, 1'b1, 1'b0, 1'b1, Generated = p1y, p2y, Reference = 1'b1, 1'b1 137 | p1a = 1'b0; p1b = 1'b1; p1c = 1'b0; p1d = 1'b0; p2a = 1'b0; p2b = 1'b1; p2c = 1'b0; p2d = 1'b1; // Set input values 138 | #period; 139 | if (!(p1y === 1'b1 && p2y === 1'b1)) begin 140 | $display("Mismatch at index 9: Inputs = [%b, %b, %b, %b, %b, %b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 1'b0, 1'b1, 1'b0, 1'b0, 1'b0, 1'b1, 1'b0, 1'b1, p1y, p2y, 1'b1, 1'b1); 141 | mismatch_count = mismatch_count + 1; 142 | end 143 | 144 | else begin 145 | $display("Test 9 passed!"); 146 | end 147 | 148 | // Tick 10: Inputs = 1'b0, 1'b1, 1'b0, 1'b0, 1'b0, 1'b1, 1'b0, 1'b1, Generated = p1y, p2y, Reference = 1'b1, 1'b1 149 | p1a = 1'b0; p1b = 1'b1; p1c = 1'b0; p1d = 1'b0; p2a = 1'b0; p2b = 1'b1; p2c = 1'b0; p2d = 1'b1; // Set input values 150 | #period; 151 | if (!(p1y === 1'b1 && p2y === 1'b1)) begin 152 | $display("Mismatch at index 10: Inputs = [%b, %b, %b, %b, %b, %b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 1'b0, 1'b1, 1'b0, 1'b0, 1'b0, 1'b1, 1'b0, 1'b1, p1y, p2y, 1'b1, 1'b1); 153 | mismatch_count = mismatch_count + 1; 154 | end 155 | 156 | else begin 157 | $display("Test 10 passed!"); 158 | end 159 | 160 | // Tick 11: Inputs = 1'b0, 1'b1, 1'b0, 1'b1, 1'b0, 1'b1, 1'b1, 1'b0, Generated = p1y, p2y, Reference = 1'b1, 1'b1 161 | p1a = 1'b0; p1b = 1'b1; p1c = 1'b0; p1d = 1'b1; p2a = 1'b0; p2b = 1'b1; p2c = 1'b1; p2d = 1'b0; // Set input values 162 | #period; 163 | if (!(p1y === 1'b1 && p2y === 1'b1)) begin 164 | $display("Mismatch at index 11: Inputs = [%b, %b, %b, %b, %b, %b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 1'b0, 1'b1, 1'b0, 1'b1, 1'b0, 1'b1, 1'b1, 1'b0, p1y, p2y, 1'b1, 1'b1); 165 | mismatch_count = mismatch_count + 1; 166 | end 167 | 168 | else begin 169 | $display("Test 11 passed!"); 170 | end 171 | 172 | // Tick 12: Inputs = 1'b0, 1'b1, 1'b0, 1'b1, 1'b0, 1'b1, 1'b1, 1'b0, Generated = p1y, p2y, Reference = 1'b1, 1'b1 173 | p1a = 1'b0; p1b = 1'b1; p1c = 1'b0; p1d = 1'b1; p2a = 1'b0; p2b = 1'b1; p2c = 1'b1; p2d = 1'b0; // Set input values 174 | #period; 175 | if (!(p1y === 1'b1 && p2y === 1'b1)) begin 176 | $display("Mismatch at index 12: Inputs = [%b, %b, %b, %b, %b, %b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 1'b0, 1'b1, 1'b0, 1'b1, 1'b0, 1'b1, 1'b1, 1'b0, p1y, p2y, 1'b1, 1'b1); 177 | mismatch_count = mismatch_count + 1; 178 | end 179 | 180 | else begin 181 | $display("Test 12 passed!"); 182 | end 183 | 184 | // Tick 13: Inputs = 1'b0, 1'b1, 1'b1, 1'b0, 1'b0, 1'b1, 1'b1, 1'b1, Generated = p1y, p2y, Reference = 1'b1, 1'b1 185 | p1a = 1'b0; p1b = 1'b1; p1c = 1'b1; p1d = 1'b0; p2a = 1'b0; p2b = 1'b1; p2c = 1'b1; p2d = 1'b1; // Set input values 186 | #period; 187 | if (!(p1y === 1'b1 && p2y === 1'b1)) begin 188 | $display("Mismatch at index 13: Inputs = [%b, %b, %b, %b, %b, %b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 1'b0, 1'b1, 1'b1, 1'b0, 1'b0, 1'b1, 1'b1, 1'b1, p1y, p2y, 1'b1, 1'b1); 189 | mismatch_count = mismatch_count + 1; 190 | end 191 | 192 | else begin 193 | $display("Test 13 passed!"); 194 | end 195 | 196 | // Tick 14: Inputs = 1'b0, 1'b1, 1'b1, 1'b0, 1'b0, 1'b1, 1'b1, 1'b1, Generated = p1y, p2y, Reference = 1'b1, 1'b1 197 | p1a = 1'b0; p1b = 1'b1; p1c = 1'b1; p1d = 1'b0; p2a = 1'b0; p2b = 1'b1; p2c = 1'b1; p2d = 1'b1; // Set input values 198 | #period; 199 | if (!(p1y === 1'b1 && p2y === 1'b1)) begin 200 | $display("Mismatch at index 14: Inputs = [%b, %b, %b, %b, %b, %b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 1'b0, 1'b1, 1'b1, 1'b0, 1'b0, 1'b1, 1'b1, 1'b1, p1y, p2y, 1'b1, 1'b1); 201 | mismatch_count = mismatch_count + 1; 202 | end 203 | 204 | else begin 205 | $display("Test 14 passed!"); 206 | end 207 | 208 | // Tick 15: Inputs = 1'b0, 1'b1, 1'b1, 1'b1, 1'b1, 1'b0, 1'b0, 1'b0, Generated = p1y, p2y, Reference = 1'b1, 1'b1 209 | p1a = 1'b0; p1b = 1'b1; p1c = 1'b1; p1d = 1'b1; p2a = 1'b1; p2b = 1'b0; p2c = 1'b0; p2d = 1'b0; // Set input values 210 | #period; 211 | if (!(p1y === 1'b1 && p2y === 1'b1)) begin 212 | $display("Mismatch at index 15: Inputs = [%b, %b, %b, %b, %b, %b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 1'b0, 1'b1, 1'b1, 1'b1, 1'b1, 1'b0, 1'b0, 1'b0, p1y, p2y, 1'b1, 1'b1); 213 | mismatch_count = mismatch_count + 1; 214 | end 215 | 216 | else begin 217 | $display("Test 15 passed!"); 218 | end 219 | 220 | // Tick 16: Inputs = 1'b0, 1'b1, 1'b1, 1'b1, 1'b1, 1'b0, 1'b0, 1'b0, Generated = p1y, p2y, Reference = 1'b1, 1'b1 221 | p1a = 1'b0; p1b = 1'b1; p1c = 1'b1; p1d = 1'b1; p2a = 1'b1; p2b = 1'b0; p2c = 1'b0; p2d = 1'b0; // Set input values 222 | #period; 223 | if (!(p1y === 1'b1 && p2y === 1'b1)) begin 224 | $display("Mismatch at index 16: Inputs = [%b, %b, %b, %b, %b, %b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 1'b0, 1'b1, 1'b1, 1'b1, 1'b1, 1'b0, 1'b0, 1'b0, p1y, p2y, 1'b1, 1'b1); 225 | mismatch_count = mismatch_count + 1; 226 | end 227 | 228 | else begin 229 | $display("Test 16 passed!"); 230 | end 231 | 232 | // Tick 17: Inputs = 1'b1, 1'b0, 1'b0, 1'b0, 1'b1, 1'b0, 1'b0, 1'b1, Generated = p1y, p2y, Reference = 1'b1, 1'b1 233 | p1a = 1'b1; p1b = 1'b0; p1c = 1'b0; p1d = 1'b0; p2a = 1'b1; p2b = 1'b0; p2c = 1'b0; p2d = 1'b1; // Set input values 234 | #period; 235 | if (!(p1y === 1'b1 && p2y === 1'b1)) begin 236 | $display("Mismatch at index 17: Inputs = [%b, %b, %b, %b, %b, %b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 1'b1, 1'b0, 1'b0, 1'b0, 1'b1, 1'b0, 1'b0, 1'b1, p1y, p2y, 1'b1, 1'b1); 237 | mismatch_count = mismatch_count + 1; 238 | end 239 | 240 | else begin 241 | $display("Test 17 passed!"); 242 | end 243 | 244 | // Tick 18: Inputs = 1'b1, 1'b0, 1'b0, 1'b0, 1'b1, 1'b0, 1'b0, 1'b1, Generated = p1y, p2y, Reference = 1'b1, 1'b1 245 | p1a = 1'b1; p1b = 1'b0; p1c = 1'b0; p1d = 1'b0; p2a = 1'b1; p2b = 1'b0; p2c = 1'b0; p2d = 1'b1; // Set input values 246 | #period; 247 | if (!(p1y === 1'b1 && p2y === 1'b1)) begin 248 | $display("Mismatch at index 18: Inputs = [%b, %b, %b, %b, %b, %b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 1'b1, 1'b0, 1'b0, 1'b0, 1'b1, 1'b0, 1'b0, 1'b1, p1y, p2y, 1'b1, 1'b1); 249 | mismatch_count = mismatch_count + 1; 250 | end 251 | 252 | else begin 253 | $display("Test 18 passed!"); 254 | end 255 | 256 | // Tick 19: Inputs = 1'b1, 1'b0, 1'b0, 1'b1, 1'b1, 1'b0, 1'b1, 1'b0, Generated = p1y, p2y, Reference = 1'b1, 1'b1 257 | p1a = 1'b1; p1b = 1'b0; p1c = 1'b0; p1d = 1'b1; p2a = 1'b1; p2b = 1'b0; p2c = 1'b1; p2d = 1'b0; // Set input values 258 | #period; 259 | if (!(p1y === 1'b1 && p2y === 1'b1)) begin 260 | $display("Mismatch at index 19: Inputs = [%b, %b, %b, %b, %b, %b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 1'b1, 1'b0, 1'b0, 1'b1, 1'b1, 1'b0, 1'b1, 1'b0, p1y, p2y, 1'b1, 1'b1); 261 | mismatch_count = mismatch_count + 1; 262 | end 263 | 264 | else begin 265 | $display("Test 19 passed!"); 266 | end 267 | 268 | // Tick 20: Inputs = 1'b1, 1'b0, 1'b0, 1'b1, 1'b1, 1'b0, 1'b1, 1'b0, Generated = p1y, p2y, Reference = 1'b1, 1'b1 269 | p1a = 1'b1; p1b = 1'b0; p1c = 1'b0; p1d = 1'b1; p2a = 1'b1; p2b = 1'b0; p2c = 1'b1; p2d = 1'b0; // Set input values 270 | #period; 271 | if (!(p1y === 1'b1 && p2y === 1'b1)) begin 272 | $display("Mismatch at index 20: Inputs = [%b, %b, %b, %b, %b, %b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 1'b1, 1'b0, 1'b0, 1'b1, 1'b1, 1'b0, 1'b1, 1'b0, p1y, p2y, 1'b1, 1'b1); 273 | mismatch_count = mismatch_count + 1; 274 | end 275 | 276 | else begin 277 | $display("Test 20 passed!"); 278 | end 279 | 280 | // Tick 21: Inputs = 1'b1, 1'b0, 1'b1, 1'b0, 1'b1, 1'b0, 1'b1, 1'b1, Generated = p1y, p2y, Reference = 1'b1, 1'b1 281 | p1a = 1'b1; p1b = 1'b0; p1c = 1'b1; p1d = 1'b0; p2a = 1'b1; p2b = 1'b0; p2c = 1'b1; p2d = 1'b1; // Set input values 282 | #period; 283 | if (!(p1y === 1'b1 && p2y === 1'b1)) begin 284 | $display("Mismatch at index 21: Inputs = [%b, %b, %b, %b, %b, %b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 1'b1, 1'b0, 1'b1, 1'b0, 1'b1, 1'b0, 1'b1, 1'b1, p1y, p2y, 1'b1, 1'b1); 285 | mismatch_count = mismatch_count + 1; 286 | end 287 | 288 | else begin 289 | $display("Test 21 passed!"); 290 | end 291 | 292 | // Tick 22: Inputs = 1'b1, 1'b0, 1'b1, 1'b0, 1'b1, 1'b0, 1'b1, 1'b1, Generated = p1y, p2y, Reference = 1'b1, 1'b1 293 | p1a = 1'b1; p1b = 1'b0; p1c = 1'b1; p1d = 1'b0; p2a = 1'b1; p2b = 1'b0; p2c = 1'b1; p2d = 1'b1; // Set input values 294 | #period; 295 | if (!(p1y === 1'b1 && p2y === 1'b1)) begin 296 | $display("Mismatch at index 22: Inputs = [%b, %b, %b, %b, %b, %b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 1'b1, 1'b0, 1'b1, 1'b0, 1'b1, 1'b0, 1'b1, 1'b1, p1y, p2y, 1'b1, 1'b1); 297 | mismatch_count = mismatch_count + 1; 298 | end 299 | 300 | else begin 301 | $display("Test 22 passed!"); 302 | end 303 | 304 | // Tick 23: Inputs = 1'b1, 1'b0, 1'b1, 1'b1, 1'b1, 1'b1, 1'b0, 1'b0, Generated = p1y, p2y, Reference = 1'b1, 1'b1 305 | p1a = 1'b1; p1b = 1'b0; p1c = 1'b1; p1d = 1'b1; p2a = 1'b1; p2b = 1'b1; p2c = 1'b0; p2d = 1'b0; // Set input values 306 | #period; 307 | if (!(p1y === 1'b1 && p2y === 1'b1)) begin 308 | $display("Mismatch at index 23: Inputs = [%b, %b, %b, %b, %b, %b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 1'b1, 1'b0, 1'b1, 1'b1, 1'b1, 1'b1, 1'b0, 1'b0, p1y, p2y, 1'b1, 1'b1); 309 | mismatch_count = mismatch_count + 1; 310 | end 311 | 312 | else begin 313 | $display("Test 23 passed!"); 314 | end 315 | 316 | // Tick 24: Inputs = 1'b1, 1'b0, 1'b1, 1'b1, 1'b1, 1'b1, 1'b0, 1'b0, Generated = p1y, p2y, Reference = 1'b1, 1'b1 317 | p1a = 1'b1; p1b = 1'b0; p1c = 1'b1; p1d = 1'b1; p2a = 1'b1; p2b = 1'b1; p2c = 1'b0; p2d = 1'b0; // Set input values 318 | #period; 319 | if (!(p1y === 1'b1 && p2y === 1'b1)) begin 320 | $display("Mismatch at index 24: Inputs = [%b, %b, %b, %b, %b, %b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 1'b1, 1'b0, 1'b1, 1'b1, 1'b1, 1'b1, 1'b0, 1'b0, p1y, p2y, 1'b1, 1'b1); 321 | mismatch_count = mismatch_count + 1; 322 | end 323 | 324 | else begin 325 | $display("Test 24 passed!"); 326 | end 327 | 328 | // Tick 25: Inputs = 1'b1, 1'b1, 1'b0, 1'b0, 1'b1, 1'b1, 1'b0, 1'b1, Generated = p1y, p2y, Reference = 1'b1, 1'b1 329 | p1a = 1'b1; p1b = 1'b1; p1c = 1'b0; p1d = 1'b0; p2a = 1'b1; p2b = 1'b1; p2c = 1'b0; p2d = 1'b1; // Set input values 330 | #period; 331 | if (!(p1y === 1'b1 && p2y === 1'b1)) begin 332 | $display("Mismatch at index 25: Inputs = [%b, %b, %b, %b, %b, %b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 1'b1, 1'b1, 1'b0, 1'b0, 1'b1, 1'b1, 1'b0, 1'b1, p1y, p2y, 1'b1, 1'b1); 333 | mismatch_count = mismatch_count + 1; 334 | end 335 | 336 | else begin 337 | $display("Test 25 passed!"); 338 | end 339 | 340 | // Tick 26: Inputs = 1'b1, 1'b1, 1'b0, 1'b0, 1'b1, 1'b1, 1'b0, 1'b1, Generated = p1y, p2y, Reference = 1'b1, 1'b1 341 | p1a = 1'b1; p1b = 1'b1; p1c = 1'b0; p1d = 1'b0; p2a = 1'b1; p2b = 1'b1; p2c = 1'b0; p2d = 1'b1; // Set input values 342 | #period; 343 | if (!(p1y === 1'b1 && p2y === 1'b1)) begin 344 | $display("Mismatch at index 26: Inputs = [%b, %b, %b, %b, %b, %b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 1'b1, 1'b1, 1'b0, 1'b0, 1'b1, 1'b1, 1'b0, 1'b1, p1y, p2y, 1'b1, 1'b1); 345 | mismatch_count = mismatch_count + 1; 346 | end 347 | 348 | else begin 349 | $display("Test 26 passed!"); 350 | end 351 | 352 | // Tick 27: Inputs = 1'b1, 1'b1, 1'b0, 1'b1, 1'b1, 1'b1, 1'b1, 1'b0, Generated = p1y, p2y, Reference = 1'b1, 1'b1 353 | p1a = 1'b1; p1b = 1'b1; p1c = 1'b0; p1d = 1'b1; p2a = 1'b1; p2b = 1'b1; p2c = 1'b1; p2d = 1'b0; // Set input values 354 | #period; 355 | if (!(p1y === 1'b1 && p2y === 1'b1)) begin 356 | $display("Mismatch at index 27: Inputs = [%b, %b, %b, %b, %b, %b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 1'b1, 1'b1, 1'b0, 1'b1, 1'b1, 1'b1, 1'b1, 1'b0, p1y, p2y, 1'b1, 1'b1); 357 | mismatch_count = mismatch_count + 1; 358 | end 359 | 360 | else begin 361 | $display("Test 27 passed!"); 362 | end 363 | 364 | // Tick 28: Inputs = 1'b1, 1'b1, 1'b0, 1'b1, 1'b1, 1'b1, 1'b1, 1'b0, Generated = p1y, p2y, Reference = 1'b1, 1'b1 365 | p1a = 1'b1; p1b = 1'b1; p1c = 1'b0; p1d = 1'b1; p2a = 1'b1; p2b = 1'b1; p2c = 1'b1; p2d = 1'b0; // Set input values 366 | #period; 367 | if (!(p1y === 1'b1 && p2y === 1'b1)) begin 368 | $display("Mismatch at index 28: Inputs = [%b, %b, %b, %b, %b, %b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 1'b1, 1'b1, 1'b0, 1'b1, 1'b1, 1'b1, 1'b1, 1'b0, p1y, p2y, 1'b1, 1'b1); 369 | mismatch_count = mismatch_count + 1; 370 | end 371 | 372 | else begin 373 | $display("Test 28 passed!"); 374 | end 375 | 376 | // Tick 29: Inputs = 1'b1, 1'b1, 1'b1, 1'b0, 1'b1, 1'b1, 1'b1, 1'b1, Generated = p1y, p2y, Reference = 1'b1, 1'b0 377 | p1a = 1'b1; p1b = 1'b1; p1c = 1'b1; p1d = 1'b0; p2a = 1'b1; p2b = 1'b1; p2c = 1'b1; p2d = 1'b1; // Set input values 378 | #period; 379 | if (!(p1y === 1'b1 && p2y === 1'b0)) begin 380 | $display("Mismatch at index 29: Inputs = [%b, %b, %b, %b, %b, %b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 1'b1, 1'b1, 1'b1, 1'b0, 1'b1, 1'b1, 1'b1, 1'b1, p1y, p2y, 1'b1, 1'b0); 381 | mismatch_count = mismatch_count + 1; 382 | end 383 | 384 | else begin 385 | $display("Test 29 passed!"); 386 | end 387 | 388 | // Tick 30: Inputs = 1'b1, 1'b1, 1'b1, 1'b0, 1'b1, 1'b1, 1'b1, 1'b1, Generated = p1y, p2y, Reference = 1'b1, 1'b0 389 | p1a = 1'b1; p1b = 1'b1; p1c = 1'b1; p1d = 1'b0; p2a = 1'b1; p2b = 1'b1; p2c = 1'b1; p2d = 1'b1; // Set input values 390 | #period; 391 | if (!(p1y === 1'b1 && p2y === 1'b0)) begin 392 | $display("Mismatch at index 30: Inputs = [%b, %b, %b, %b, %b, %b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 1'b1, 1'b1, 1'b1, 1'b0, 1'b1, 1'b1, 1'b1, 1'b1, p1y, p2y, 1'b1, 1'b0); 393 | mismatch_count = mismatch_count + 1; 394 | end 395 | 396 | else begin 397 | $display("Test 30 passed!"); 398 | end 399 | 400 | // Tick 31: Inputs = 1'b1, 1'b1, 1'b1, 1'b1, 1'b0, 1'b0, 1'b0, 1'b0, Generated = p1y, p2y, Reference = 1'b0, 1'b1 401 | p1a = 1'b1; p1b = 1'b1; p1c = 1'b1; p1d = 1'b1; p2a = 1'b0; p2b = 1'b0; p2c = 1'b0; p2d = 1'b0; // Set input values 402 | #period; 403 | if (!(p1y === 1'b0 && p2y === 1'b1)) begin 404 | $display("Mismatch at index 31: Inputs = [%b, %b, %b, %b, %b, %b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 1'b1, 1'b1, 1'b1, 1'b1, 1'b0, 1'b0, 1'b0, 1'b0, p1y, p2y, 1'b0, 1'b1); 405 | mismatch_count = mismatch_count + 1; 406 | end 407 | 408 | else begin 409 | $display("Test 31 passed!"); 410 | end 411 | 412 | // Tick 32: Inputs = 1'b1, 1'b1, 1'b1, 1'b1, 1'b0, 1'b0, 1'b0, 1'b0, Generated = p1y, p2y, Reference = 1'b0, 1'b1 413 | p1a = 1'b1; p1b = 1'b1; p1c = 1'b1; p1d = 1'b1; p2a = 1'b0; p2b = 1'b0; p2c = 1'b0; p2d = 1'b0; // Set input values 414 | #period; 415 | if (!(p1y === 1'b0 && p2y === 1'b1)) begin 416 | $display("Mismatch at index 32: Inputs = [%b, %b, %b, %b, %b, %b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 1'b1, 1'b1, 1'b1, 1'b1, 1'b0, 1'b0, 1'b0, 1'b0, p1y, p2y, 1'b0, 1'b1); 417 | mismatch_count = mismatch_count + 1; 418 | end 419 | 420 | else begin 421 | $display("Test 32 passed!"); 422 | end 423 | 424 | // Tick 33: Inputs = 1'b0, 1'b0, 1'b0, 1'b0, 1'b0, 1'b0, 1'b0, 1'b1, Generated = p1y, p2y, Reference = 1'b1, 1'b1 425 | p1a = 1'b0; p1b = 1'b0; p1c = 1'b0; p1d = 1'b0; p2a = 1'b0; p2b = 1'b0; p2c = 1'b0; p2d = 1'b1; // Set input values 426 | #period; 427 | if (!(p1y === 1'b1 && p2y === 1'b1)) begin 428 | $display("Mismatch at index 33: Inputs = [%b, %b, %b, %b, %b, %b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 1'b0, 1'b0, 1'b0, 1'b0, 1'b0, 1'b0, 1'b0, 1'b1, p1y, p2y, 1'b1, 1'b1); 429 | mismatch_count = mismatch_count + 1; 430 | end 431 | 432 | else begin 433 | $display("Test 33 passed!"); 434 | end 435 | 436 | // Tick 34: Inputs = 1'b0, 1'b0, 1'b0, 1'b0, 1'b0, 1'b0, 1'b0, 1'b1, Generated = p1y, p2y, Reference = 1'b1, 1'b1 437 | p1a = 1'b0; p1b = 1'b0; p1c = 1'b0; p1d = 1'b0; p2a = 1'b0; p2b = 1'b0; p2c = 1'b0; p2d = 1'b1; // Set input values 438 | #period; 439 | if (!(p1y === 1'b1 && p2y === 1'b1)) begin 440 | $display("Mismatch at index 34: Inputs = [%b, %b, %b, %b, %b, %b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 1'b0, 1'b0, 1'b0, 1'b0, 1'b0, 1'b0, 1'b0, 1'b1, p1y, p2y, 1'b1, 1'b1); 441 | mismatch_count = mismatch_count + 1; 442 | end 443 | 444 | else begin 445 | $display("Test 34 passed!"); 446 | end 447 | 448 | // Tick 35: Inputs = 1'b0, 1'b0, 1'b0, 1'b1, 1'b0, 1'b0, 1'b1, 1'b0, Generated = p1y, p2y, Reference = 1'b1, 1'b1 449 | p1a = 1'b0; p1b = 1'b0; p1c = 1'b0; p1d = 1'b1; p2a = 1'b0; p2b = 1'b0; p2c = 1'b1; p2d = 1'b0; // Set input values 450 | #period; 451 | if (!(p1y === 1'b1 && p2y === 1'b1)) begin 452 | $display("Mismatch at index 35: Inputs = [%b, %b, %b, %b, %b, %b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 1'b0, 1'b0, 1'b0, 1'b1, 1'b0, 1'b0, 1'b1, 1'b0, p1y, p2y, 1'b1, 1'b1); 453 | mismatch_count = mismatch_count + 1; 454 | end 455 | 456 | else begin 457 | $display("Test 35 passed!"); 458 | end 459 | 460 | // Tick 36: Inputs = 1'b0, 1'b0, 1'b0, 1'b1, 1'b0, 1'b0, 1'b1, 1'b0, Generated = p1y, p2y, Reference = 1'b1, 1'b1 461 | p1a = 1'b0; p1b = 1'b0; p1c = 1'b0; p1d = 1'b1; p2a = 1'b0; p2b = 1'b0; p2c = 1'b1; p2d = 1'b0; // Set input values 462 | #period; 463 | if (!(p1y === 1'b1 && p2y === 1'b1)) begin 464 | $display("Mismatch at index 36: Inputs = [%b, %b, %b, %b, %b, %b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 1'b0, 1'b0, 1'b0, 1'b1, 1'b0, 1'b0, 1'b1, 1'b0, p1y, p2y, 1'b1, 1'b1); 465 | mismatch_count = mismatch_count + 1; 466 | end 467 | 468 | else begin 469 | $display("Test 36 passed!"); 470 | end 471 | 472 | // Tick 37: Inputs = 1'b0, 1'b0, 1'b1, 1'b0, 1'b0, 1'b0, 1'b1, 1'b1, Generated = p1y, p2y, Reference = 1'b1, 1'b1 473 | p1a = 1'b0; p1b = 1'b0; p1c = 1'b1; p1d = 1'b0; p2a = 1'b0; p2b = 1'b0; p2c = 1'b1; p2d = 1'b1; // Set input values 474 | #period; 475 | if (!(p1y === 1'b1 && p2y === 1'b1)) begin 476 | $display("Mismatch at index 37: Inputs = [%b, %b, %b, %b, %b, %b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 1'b0, 1'b0, 1'b1, 1'b0, 1'b0, 1'b0, 1'b1, 1'b1, p1y, p2y, 1'b1, 1'b1); 477 | mismatch_count = mismatch_count + 1; 478 | end 479 | 480 | else begin 481 | $display("Test 37 passed!"); 482 | end 483 | 484 | // Tick 38: Inputs = 1'b0, 1'b0, 1'b1, 1'b0, 1'b0, 1'b0, 1'b1, 1'b1, Generated = p1y, p2y, Reference = 1'b1, 1'b1 485 | p1a = 1'b0; p1b = 1'b0; p1c = 1'b1; p1d = 1'b0; p2a = 1'b0; p2b = 1'b0; p2c = 1'b1; p2d = 1'b1; // Set input values 486 | #period; 487 | if (!(p1y === 1'b1 && p2y === 1'b1)) begin 488 | $display("Mismatch at index 38: Inputs = [%b, %b, %b, %b, %b, %b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 1'b0, 1'b0, 1'b1, 1'b0, 1'b0, 1'b0, 1'b1, 1'b1, p1y, p2y, 1'b1, 1'b1); 489 | mismatch_count = mismatch_count + 1; 490 | end 491 | 492 | else begin 493 | $display("Test 38 passed!"); 494 | end 495 | 496 | if (mismatch_count == 0) 497 | $display("All tests passed!"); 498 | else 499 | $display("%0d mismatches out of %0d total tests.", mismatch_count, 39); 500 | $finish; 501 | end 502 | 503 | endmodule 504 | -------------------------------------------------------------------------------- /demo_files/AutoChip/TSS/Adder3_0_tb.v: -------------------------------------------------------------------------------- 1 | `timescale 1 ns/10 ps // time-unit = 1 ns, precision = 10 ps 2 | 3 | module top_module_tb; 4 | 5 | // duration for each bit = 20 * timescale = 20 * 1 ns = 20ns 6 | localparam period = 20; 7 | 8 | reg [2:0] a; 9 | reg [2:0] b; 10 | reg cin; 11 | 12 | wire [2:0] cout; 13 | wire [2:0] sum; 14 | 15 | 16 | integer mismatch_count; 17 | 18 | top_module UUT (.a(a), .b(b), .cin(cin), .cout(cout), .sum(sum)); 19 | 20 | initial begin 21 | mismatch_count = 0; 22 | 23 | // Tick 0: Inputs = 3'b010, 3'b011, 1'b0, Generated = cout, sum, Reference = 3'b010, 3'b101 24 | a = 3'b010; b = 3'b011; cin = 1'b0; // Set input values 25 | #period; 26 | if (!(cout === 3'b010 && sum === 3'b101)) begin 27 | $display("Mismatch at index 0: Inputs = [%b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 3'b010, 3'b011, 1'b0, cout, sum, 3'b010, 3'b101); 28 | mismatch_count = mismatch_count + 1; 29 | end 30 | 31 | else begin 32 | $display("Test 0 passed!"); 33 | end 34 | 35 | // Tick 1: Inputs = 3'b010, 3'b011, 1'b0, Generated = cout, sum, Reference = 3'b010, 3'b101 36 | a = 3'b010; b = 3'b011; cin = 1'b0; // Set input values 37 | #period; 38 | if (!(cout === 3'b010 && sum === 3'b101)) begin 39 | $display("Mismatch at index 1: Inputs = [%b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 3'b010, 3'b011, 1'b0, cout, sum, 3'b010, 3'b101); 40 | mismatch_count = mismatch_count + 1; 41 | end 42 | 43 | else begin 44 | $display("Test 1 passed!"); 45 | end 46 | 47 | // Tick 2: Inputs = 3'b010, 3'b011, 1'b1, Generated = cout, sum, Reference = 3'b011, 3'b110 48 | a = 3'b010; b = 3'b011; cin = 1'b1; // Set input values 49 | #period; 50 | if (!(cout === 3'b011 && sum === 3'b110)) begin 51 | $display("Mismatch at index 2: Inputs = [%b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 3'b010, 3'b011, 1'b1, cout, sum, 3'b011, 3'b110); 52 | mismatch_count = mismatch_count + 1; 53 | end 54 | 55 | else begin 56 | $display("Test 2 passed!"); 57 | end 58 | 59 | // Tick 3: Inputs = 3'b010, 3'b011, 1'b1, Generated = cout, sum, Reference = 3'b011, 3'b110 60 | a = 3'b010; b = 3'b011; cin = 1'b1; // Set input values 61 | #period; 62 | if (!(cout === 3'b011 && sum === 3'b110)) begin 63 | $display("Mismatch at index 3: Inputs = [%b, %b, %b], Generated = [%b, %b], Reference = [%b, %b]", 3'b010, 3'b011, 1'b1, cout, sum, 3'b011, 3'b110); 64 | mismatch_count = mismatch_count + 1; 65 | end 66 | 67 | else begin 68 | $display("Test 3 passed!"); 69 | end 70 | 71 | if (mismatch_count == 0) 72 | $display("All tests passed!"); 73 | else 74 | $display("%0d mismatches out of %0d total tests.", mismatch_count, 4); 75 | $finish; 76 | end 77 | 78 | endmodule 79 | -------------------------------------------------------------------------------- /pictures/DATE_2024_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JBlocklove/LLMs-for-EDA-Tutorial/fa108cb70fac7177a5382f3adf662e799527af49/pictures/DATE_2024_1.png -------------------------------------------------------------------------------- /pictures/DATE_2024_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JBlocklove/LLMs-for-EDA-Tutorial/fa108cb70fac7177a5382f3adf662e799527af49/pictures/DATE_2024_2.png -------------------------------------------------------------------------------- /presentations/HLSforSecurity-TSS-ETS-May-2024.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JBlocklove/LLMs-for-EDA-Tutorial/fa108cb70fac7177a5382f3adf662e799527af49/presentations/HLSforSecurity-TSS-ETS-May-2024.pdf --------------------------------------------------------------------------------