Files
CGA-bench/data/HDLBits/HDLBits_data_RTL_4omini_20.jsonl

157 lines
1.8 MiB
Plaintext
Raw Permalink Normal View History

2026-05-22 10:02:42 +08:00
{"task_id": "mux2to1v", "llmgen_RTL": ["module top_module (\n\tinput [99:0] a,\n\tinput [99:0] b,\n\tinput sel,\n\toutput [99:0] out\n);\n\tassign out = sel ? b : a;\nendmodule\n", "module top_module (\n\tinput [99:0] a,\n\tinput [99:0] b,\n\tinput sel,\n\toutput [99:0] out\n);\n\tassign out = sel ? b : a;\nendmodule\n", "module top_module (\n\tinput [99:0] a,\n\tinput [99:0] b,\n\tinput sel,\n\toutput [99:0] out\n);\n\tassign out = sel ? b : a;\nendmodule\n", "module top_module (\n\tinput [99:0] a,\n\tinput [99:0] b,\n\tinput sel,\n\toutput [99:0] out\n);\n\tassign out = sel ? b : a;\nendmodule\n", "module top_module (\n\tinput [99:0] a,\n\tinput [99:0] b,\n\tinput sel,\n\toutput [99:0] out\n);\n\n\tassign out = (sel == 1'b0) ? a : b;\n\nendmodule\n", "module top_module (\n\tinput [99:0] a,\n\tinput [99:0] b,\n\tinput sel,\n\toutput [99:0] out\n);\n\tassign out = sel ? b : a;\nendmodule\n", "module top_module (\n input [99:0] a,\n input [99:0] b,\n input sel,\n output [99:0] out\n);\n assign out = sel ? b : a;\nendmodule\n", "module top_module (\n\tinput [99:0] a,\n\tinput [99:0] b,\n\tinput sel,\n\toutput [99:0] out\n);\n\tassign out = sel ? b : a;\nendmodule\n", "module top_module (\n input [99:0] a,\n input [99:0] b,\n input sel,\n output [99:0] out\n);\n assign out = sel ? b : a;\nendmodule\n", "module top_module (\n\tinput [99:0] a,\n\tinput [99:0] b,\n\tinput sel,\n\toutput [99:0] out\n);\n\tassign out = sel ? b : a;\nendmodule\n", "module top_module (\n\tinput [99:0] a,\n\tinput [99:0] b,\n\tinput sel,\n\toutput [99:0] out\n);\n\tassign out = sel ? b : a;\nendmodule\n", "module top_module (\n\tinput [99:0] a,\n\tinput [99:0] b,\n\tinput sel,\n\toutput [99:0] out\n);\n\tassign out = sel ? b : a;\nendmodule\n", "module top_module (\n input [99:0] a,\n input [99:0] b,\n input sel,\n output [99:0] out\n);\n assign out = sel ? b : a;\nendmodule\n", "module top_module (\n\tinput [99:0] a,\n\tinput [99:0] b,\n\tinput sel,\n\toutput [99:0] out\n);\n\n\tassign out = sel ? b : a;\n\nendmodule\n", "module top_module (\n input [99:0] a,\n input [99:0] b,\n input sel,\n output [99:0] out\n);\n assign out = sel ? b : a;\nendmodule\n", "module top_module (\n input [99:0] a,\n input [99:0] b,\n input sel,\n output [99:0] out\n);\n assign out = sel ? b : a;\nendmodule\n", "module top_module (\n input [99:0] a,\n input [99:0] b,\n input sel,\n output [99:0] out\n);\n assign out = sel ? b : a;\nendmodule\n", "module top_module (\n\tinput [99:0] a,\n\tinput [99:0] b,\n\tinput sel,\n\toutput [99:0] out\n);\n\tassign out = sel ? b : a;\nendmodule\n", "module top_module (\n\tinput [99:0] a,\n\tinput [99:0] b,\n\tinput sel,\n\toutput [99:0] out\n);\n\n\tassign out = sel ? b : a;\n\nendmodule\n", "module top_module (\n input [99:0] a,\n input [99:0] b,\n input sel,\n output [99:0] out\n);\n\nassign out = sel ? b : a;\n\nendmodule\n"]}
{"task_id": "m2014_q6b", "llmgen_RTL": ["module top_module(\n input [3:1] y,\n input w,\n output reg Y2\n);\n\nalways @(*) begin\n case (y)\n 3'b000: Y2 = 0; // State A\n 3'b001: Y2 = 0; // State B\n 3'b010: Y2 = 0; // State C\n 3'b011: Y2 = 0; // State D\n 3'b100: Y2 = 1; // State E\n 3'b101: Y2 = 1; // State F\n default: Y2 = 0; // Default case\n endcase\nend\n\nendmodule\n", "module top_module(\n input [3:1] y,\n input w,\n output reg Y2);\n\nalways @(*) begin\n case (y)\n 3'b000: Y2 = (w == 0) ? 0 : 0; // State A\n 3'b001: Y2 = (w == 0) ? 0 : 0; // State B\n 3'b010: Y2 = (w == 0) ? 0 : 0; // State C\n 3'b011: Y2 = (w == 0) ? 0 : 0; // State D\n 3'b100: Y2 = (w == 0) ? 1 : 0; // State E\n 3'b101: Y2 = (w == 0) ? 1 : 0; // State F\n default: Y2 = 0; // Undefined state\n endcase\nend\n\nendmodule\n", "module top_module(\n input [3:1] y,\n input w,\n output reg Y2);\n\n always @(*) begin\n case (y)\n 3'b000: Y2 = (w) ? 0 : 0; // State A\n 3'b001: Y2 = (w) ? 1 : 0; // State B\n 3'b010: Y2 = (w) ? 1 : 0; // State C\n 3'b011: Y2 = (w) ? 1 : 0; // State D\n 3'b100: Y2 = (w) ? 1 : 1; // State E\n 3'b101: Y2 = (w) ? 1 : 0; // State F\n default: Y2 = 0; // Default case\n endcase\n end\nendmodule\n", "module top_module(\n\tinput [3:1] y,\n\tinput w,\n\toutput reg Y2);\n\n\talways @* begin\n\t\tcase (y)\n\t\t\t3'b000: Y2 = (w) ? 1'b0 : 1'b0; // State A\n\t\t\t3'b001: Y2 = (w) ? 1'b1 : 1'b0; // State B\n\t\t\t3'b010: Y2 = (w) ? 1'b1 : 1'b0; // State C\n\t\t\t3'b011: Y2 = (w) ? 1'b1 : 1'b0; // State D\n\t\t\t3'b100: Y2 = (w) ? 1'b1 : 1'b1; // State E\n\t\t\t3'b101: Y2 = (w) ? 1'b1 : 1'b0; // State F\n\t\t\tdefault: Y2 = 1'b0; // Default case\n\t\tendcase\n\tend\nendmodule\n", "module top_module(\n\tinput [3:1] y,\n\tinput w,\n\toutput reg Y2);\n\n\talways @(*) begin\n\t\tcase (y)\n\t\t\t3'b000: Y2 = (w == 0) ? 0 : 0; // State A\n\t\t\t3'b001: Y2 = (w == 0) ? 0 : 1; // State B\n\t\t\t3'b010: Y2 = (w == 0) ? 1 : 1; // State C\n\t\t\t3'b011: Y2 = (w == 0) ? 1 : 0; // State D\n\t\t\t3'b100: Y2 = (w == 0) ? 1 : 0; // State E\n\t\t\t3'b101: Y2 = (w == 0) ? 0 : 0; // State F\n\t\t\tdefault: Y2 = 0; // Default case\n\t\tendcase\n\tend\nendmodule\n", "module top_module(\n\tinput [3:1] y,\n\tinput w,\n\toutput reg Y2);\n\nalways @(*) begin\n\tcase (y)\n\t\t3'b000: Y2 = 0; // State A\n\t\t3'b001: Y2 = (w == 1) ? 0 : 0; // State B\n\t\t3'b010: Y2 = (w == 1) ? 1 : 0; // State C\n\t\t3'b011: Y2 = (w == 1) ? 0 : 0; // State D\n\t\t3'b100: Y2 = 1; // State E\n\t\t3'b101: Y2 = (w == 1) ? 1 : 0; // State F\n\t\tdefault: Y2 = 0;\n\tendcase\nend\n\nendmodule\n", "module top_module(\n input [3:1] y,\n input w,\n output reg Y2\n);\n always @(*) begin\n case (y)\n 3'b000: Y2 = (w == 0) ? 0 : 0; // State A\n 3'b001: Y2 = (w == 0) ? 0 : 1; // State B\n 3'b010: Y2 = (w == 0) ? 1 : 1; // State C\n 3'b011: Y2 = (w == 0) ? 0 : 1; // State D\n 3'b100: Y2 = (w == 0) ? 1 : 1; // State E\n 3'b101: Y2 = (w == 0) ? 0 : 1; // State F\n default: Y2 = 0; // Default case\n endcase\n end\nendmodule\n", "module top_module(\n input [3:1] y,\n input w,\n output reg Y2\n);\n\nalways @(*) begin\n case (y)\n 3'b000: Y2 = (w == 0) ? 0 : 0; // State A\n 3'b001: Y2 = (w == 0) ? 0 : 1; // State B\n 3'b010: Y2 = (w == 0) ? 0 : 1; // State C\n 3'b011: Y2 = (w == 0) ? 1 : 1; // State D\n 3'b100: Y2 = (w == 0) ? 1 : 1; // State E\n 3'b101: Y2 = (w == 0) ? 0 : 1; // State F\n default: Y2 = 0; // Default case\n endcase\nend\n\nendmodule\n", "module top_module(\n input [3:1] y,\n input w,\n output reg Y2\n);\n\nalways @(*) begin\n case (y)\n 3'b000: Y2 = (w == 0) ? 0 : 0; // State A\n 3'b001: Y2 = (w == 0) ? 0 : 1; // State B\n 3'b010: Y2 = (w
{"task_id": "ringer", "llmgen_RTL": ["module top_module(\n input ring, \n input vibrate_mode,\n output ringer,\n output motor\n);\n assign ringer = ring & ~vibrate_mode;\n assign motor = ring & vibrate_mode;\nendmodule\n", "module top_module(\n\tinput ring, \n\tinput vibrate_mode,\n\toutput ringer,\n\toutput motor\n);\n\n\tassign ringer = ring & ~vibrate_mode;\n\tassign motor = ring & vibrate_mode;\n\nendmodule\n", "module top_module(\n\tinput ring, \n\tinput vibrate_mode,\n\toutput ringer,\n\toutput motor\n);\n\n\tassign ringer = ring & ~vibrate_mode;\n\tassign motor = ring & vibrate_mode;\n\nendmodule\n", "module top_module(\n\tinput ring, \n\tinput vibrate_mode,\n\toutput ringer,\n\toutput motor\n);\n\tassign ringer = ring & ~vibrate_mode;\n\tassign motor = ring & vibrate_mode;\nendmodule\n", "module top_module(\n\tinput ring, \n\tinput vibrate_mode,\n\toutput ringer,\n\toutput motor\n);\n\n\tassign ringer = ring & ~vibrate_mode;\n\tassign motor = ring & vibrate_mode;\n\nendmodule\n", "module top_module(\n\tinput ring, \n\tinput vibrate_mode,\n\toutput ringer,\n\toutput motor\n);\n\nassign motor = ring && vibrate_mode;\nassign ringer = ring && ~vibrate_mode;\n\nendmodule\n", "module top_module(\n\tinput ring, \n\tinput vibrate_mode,\n\toutput ringer,\n\toutput motor\n);\n\tassign ringer = (ring && ~vibrate_mode);\n\tassign motor = (ring && vibrate_mode);\nendmodule\n", "module top_module(\n\tinput ring, \n\tinput vibrate_mode,\n\toutput ringer,\n\toutput motor\n);\n\nassign ringer = (ring && ~vibrate_mode);\nassign motor = (ring && vibrate_mode);\n\nendmodule\n", "module top_module(\n\tinput ring, \n\tinput vibrate_mode,\n\toutput ringer,\n\toutput motor\n);\n\nassign ringer = ring & ~vibrate_mode;\nassign motor = ring & vibrate_mode;\n\nendmodule\n", "module top_module(\n input ring, \n input vibrate_mode,\n output ringer,\n output motor\n);\n assign ringer = ring & ~vibrate_mode;\n assign motor = ring & vibrate_mode;\nendmodule\n", "module top_module(\n\tinput ring, \n\tinput vibrate_mode,\n\toutput reg ringer,\n\toutput reg motor\n);\n\nalways @(*) begin\n\tringer = 0;\n\tmotor = 0;\n\tif (ring) begin\n\t\tif (vibrate_mode) \n\t\t\tmotor = 1;\n\t\telse \n\t\t\tringer = 1;\n\tend\nend\n\nendmodule\n", "module top_module(\n\tinput ring, \n\tinput vibrate_mode,\n\toutput ringer,\n\toutput motor\n);\n\tassign ringer = ring & ~vibrate_mode;\n\tassign motor = ring & vibrate_mode;\n\nendmodule\n", "module top_module(\n\tinput ring, \n\tinput vibrate_mode,\n\toutput ringer,\n\toutput motor\n);\n\nassign ringer = ring & ~vibrate_mode;\nassign motor = ring & vibrate_mode;\n\nendmodule\n", "module top_module(\n input ring, \n input vibrate_mode,\n output ringer,\n output motor\n);\n assign ringer = ring & ~vibrate_mode;\n assign motor = ring & vibrate_mode;\nendmodule\n", "module top_module(\n\tinput ring, \n\tinput vibrate_mode,\n\toutput ringer,\n\toutput motor\n);\n\tassign ringer = ring & ~vibrate_mode;\n\tassign motor = ring & vibrate_mode;\nendmodule\n", "module top_module(\n input ring, \n input vibrate_mode,\n output ringer,\n output motor\n);\n assign ringer = ring && ~vibrate_mode;\n assign motor = ring && vibrate_mode;\nendmodule\n", "module top_module(\n\tinput ring, \n\tinput vibrate_mode,\n\toutput ringer,\n\toutput motor\n);\n\n\tassign ringer = ring & ~vibrate_mode;\n\tassign motor = ring & vibrate_mode;\n\nendmodule\n", "module top_module(\n input ring, \n input vibrate_mode,\n output ringer,\n output motor\n);\n\nassign ringer = ring & ~vibrate_mode;\nassign motor = ring & vibrate_mode;\n\nendmodule\n", "module top_module(\n\tinput ring, \n\tinput vibrate_mode,\n\toutput ringer,\n\toutput motor\n);\n\tassign ringer = ring & ~vibrate_mode;\n\tassign motor = ring & vibrate_mode;\nendmodule\n", "module top_module(\n\tinput ring, \n\tinput vibrate_mode,\n\toutput ringer,\n\toutput motor\n);\n\nassign ringer = ring & ~vibrate_mode;\nassign motor = ring & vibrate_mode;\n\nendmodule\n"]}
{"task_id": "alwaysblock1", "llmgen_RTL": ["module top_module(\n\tinput a, \n\tinput b,\n\toutput out_assign,\n\toutput reg out_alwaysblock\n);\n\nassign out_assign = a & b;\n\nalways @(*) begin\n\tout_alwaysblock = a & b;\nend\n\nendmodule\n", "module top_module(\n input a, \n input b,\n output out_assign,\n output reg out_alwaysblock\n);\n\nassign out_assign = a & b;\n\nalways @* begin\n out_alwaysblock = a & b;\nend\n\nendmodule\n", "module top_module(\n\tinput a, \n\tinput b,\n\toutput out_assign,\n\toutput reg out_alwaysblock\n);\n\nassign out_assign = a & b;\n\nalways @(*) begin\n\tout_alwaysblock = a & b;\nend\n\nendmodule\n", "module top_module(\n input a, \n input b,\n output out_assign,\n output reg out_alwaysblock\n);\n assign out_assign = a & b;\n\n always @(*) begin\n out_alwaysblock = a & b;\n end\nendmodule\n", "module top_module(\n\tinput a, \n\tinput b,\n\toutput out_assign,\n\toutput reg out_alwaysblock\n);\n\nassign out_assign = a & b;\n\nalways @* begin\n\tout_alwaysblock = a & b;\nend\n\nendmodule\n", "module top_module(\n\tinput a, \n\tinput b,\n\toutput out_assign,\n\toutput reg out_alwaysblock\n);\n\nassign out_assign = a & b;\n\nalways @* begin\n\tout_alwaysblock = a & b;\nend\n\nendmodule\n", "module top_module(\n\tinput a, \n\tinput b,\n\toutput out_assign,\n\toutput reg out_alwaysblock\n);\n\nassign out_assign = a & b;\n\nalways @(*) begin\n\tout_alwaysblock = a & b;\nend\n\nendmodule\n", "module top_module(\n\tinput a, \n\tinput b,\n\toutput out_assign,\n\toutput reg out_alwaysblock\n);\n\nassign out_assign = a & b;\n\nalways @(*) begin\n\tout_alwaysblock = a & b;\nend\n\nendmodule\n", "module top_module(\n\tinput a, \n\tinput b,\n\toutput out_assign,\n\toutput reg out_alwaysblock\n);\n\nassign out_assign = a & b;\n\nalways @* begin\n\tout_alwaysblock = a & b;\nend\n\nendmodule\n", "module top_module(\n\tinput a, \n\tinput b,\n\toutput out_assign,\n\toutput reg out_alwaysblock\n);\n\nassign out_assign = a & b;\n\nalways @(*) begin\n\tout_alwaysblock = a & b;\nend\n\nendmodule\n", "module top_module(\n\tinput a, \n\tinput b,\n\toutput out_assign,\n\toutput reg out_alwaysblock\n);\n\nassign out_assign = a & b;\n\nalways @(*) begin\n\tout_alwaysblock = a & b;\nend\n\nendmodule\n", "module top_module(\n\tinput a, \n\tinput b,\n\toutput out_assign,\n\toutput reg out_alwaysblock\n);\n\nassign out_assign = a & b;\n\nalways @* begin\n\tout_alwaysblock = a & b;\nend\n\nendmodule\n", "module top_module(\n\tinput a, \n\tinput b,\n\toutput out_assign,\n\toutput reg out_alwaysblock\n);\n\nassign out_assign = a & b;\n\nalways @* begin\n\tout_alwaysblock = a & b;\nend\n\nendmodule\n", "module top_module(\n\tinput a, \n\tinput b,\n\toutput out_assign,\n\toutput reg out_alwaysblock\n);\n\nassign out_assign = a & b;\n\nalways @(*) begin\n\tout_alwaysblock = a & b;\nend\n\nendmodule\n", "module top_module(\n\tinput a, \n\tinput b,\n\toutput out_assign,\n\toutput reg out_alwaysblock\n);\n\nassign out_assign = a & b;\n\nalways @(*) begin\n\tout_alwaysblock = a & b;\nend\n\nendmodule\n", "module top_module(\n input a, \n input b,\n output out_assign,\n output reg out_alwaysblock\n);\n\n// Assign statement\nassign out_assign = a & b;\n\n// Combinational always block\nalways @* begin\n out_alwaysblock = a & b;\nend\n\nendmodule\n", "module top_module(\n\tinput a, \n\tinput b,\n\toutput out_assign,\n\toutput reg out_alwaysblock\n);\n\nassign out_assign = a & b;\n\nalways @* begin\n\tout_alwaysblock = a & b;\nend\n\nendmodule\n", "module top_module(\n\tinput a, \n\tinput b,\n\toutput out_assign,\n\toutput reg out_alwaysblock\n);\n\nassign out_assign = a & b;\n\nalways @(*) begin\n\tout_alwaysblock = a & b;\nend\n\nendmodule\n", "module top_module(\n input a, \n input b,\n output out_assign,\n output reg out_alwaysblock\n);\n\nassign out_assign = a & b;\n\nalways @* begin\n out_alwaysblock = a & b;\nend\n\nendmodule\n", "module top_module(\n input a, \n input b,\n output out_assign,\n output reg out_alwaysblock\n);\n\nassign out_assig
{"task_id": "zero", "llmgen_RTL": ["module top_module(\n output zero);\n \n assign zero = 1'b0;\n\nendmodule\n", "module top_module(\n\toutput zero);\n\n\tassign zero = 1'b0;\n\nendmodule\n", "module top_module(\n\toutput zero);\n\tassign zero = 1'b0;\nendmodule\n", "module top_module(\n\toutput zero);\n\tassign zero = 1'b0;\nendmodule\n", "module top_module(\n\toutput zero);\n \n\tassign zero = 1'b0;\n\nendmodule\n", "module top_module(\n\toutput zero);\n\n\tassign zero = 1'b0;\n\nendmodule\n", "module top_module(\n\toutput zero);\n\tassign zero = 0;\nendmodule\n", "module top_module(\n\toutput zero);\n\tassign zero = 1'b0;\nendmodule\n", "module top_module(\n\toutput zero);\n\tassign zero = 1'b0;\nendmodule\n", "module top_module(\n\toutput zero);\n\n\tassign zero = 1'b0;\n\nendmodule\n", "module top_module(\n\toutput zero);\n\tassign zero = 1'b0;\nendmodule\n", "module top_module(\n\toutput zero);\n\n\tassign zero = 1'b0;\n\nendmodule\n", "module top_module(\n\toutput zero);\n\n\tassign zero = 1'b0;\n\nendmodule\n", "module top_module(\n output zero\n);\n assign zero = 1'b0;\nendmodule\n", "module top_module(\n\toutput zero);\n\tassign zero = 1'b0;\nendmodule\n", "module top_module(\n\toutput zero);\n\tassign zero = 1'b0;\nendmodule\n", "module top_module(\n\toutput zero);\n\n\tassign zero = 0;\n\nendmodule\n", "module top_module(\n\toutput zero);\n \n\tassign zero = 1'b0;\n\nendmodule\n", "module top_module(\n output zero);\n\n assign zero = 1'b0;\n\nendmodule\n", "module top_module(\n\toutput zero);\n\tassign zero = 1'b0;\nendmodule\n"]}
{"task_id": "circuit7", "llmgen_RTL": ["module top_module (\n input clk,\n input a, \n output reg q\n);\n reg [1:0] state; // Define a state variable\n\n always @(posedge clk) begin\n case (state)\n 2'b00: begin\n if (a) begin\n q <= 0;\n state <= 2'b01; // Move to state 01\n end\n end\n 2'b01: begin\n q <= 1;\n state <= 2'b10; // Move to state 10\n end\n 2'b10: begin\n if (a) begin\n q <= 0;\n state <= 2'b11; // Move to state 11\n end\n end\n 2'b11: begin\n q <= 0;\n state <= 2'b01; // Back to state 01\n end\n endcase\n end\n \n initial begin\n q = 0;\n state = 2'b00; // Initialize state\n end\nendmodule\n", "module top_module (\n input clk,\n input a, \n output reg q\n);\n \n always @(posedge clk) begin\n if (a == 0) begin\n q <= q; // retain previous value when a is 0\n end else begin\n q <= ~q; // toggle q when a is 1\n end\n end\n\nendmodule\n", "module top_module (\n input clk,\n input a, \n output reg q\n);\n always @(posedge clk) begin\n if (a == 0) begin\n q <= q; // retain previous value when a is 0\n end else begin\n q <= ~q; // toggle q when a is 1\n end\n end\nendmodule\n", "module top_module (\n input clk,\n input a, \n output reg q\n);\n\nalways @(posedge clk) begin\n if (a) begin\n q <= ~q;\n end\nend\n\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput a, \n\toutput reg q\n);\n \n reg state;\n\n always @(posedge clk) begin\n if (a == 0) begin\n q <= state; // Keep the value of q when a is 0\n end else begin\n q <= ~q; // Toggle q when a is 1\n end\n state <= q; // Store current value of q into state\n end\n\nendmodule\n", "module top_module (\n input clk,\n input a, \n output reg q\n);\n reg [1:0] state; // Define a 2-bit state variable\n\n always @(posedge clk) begin\n case (state)\n 2'b00: begin\n q <= 0;\n if (a) state <= 2'b01;\n end\n 2'b01: begin\n q <= 1;\n state <= 2'b10;\n end\n 2'b10: begin\n q <= 0;\n if (a) state <= 2'b01;\n end\n default: begin\n q <= 0;\n state <= 2'b00; // Reset state\n end\n endcase\n end\n \n initial begin\n state = 2'b00; // Initialize state\n q = 0; // Initialize output\n end\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput a, \n\toutput reg q\n);\n \n always @(posedge clk) begin\n if (a) \n q <= 0;\n else \n q <= q;\n end\n\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput a, \n\toutput reg q\n);\n\nalways @(posedge clk) begin\n\tif (a == 0) begin\n\t\tq <= q; // Hold state when a is low\n\tend else begin\n\t\tq <= ~q; // Toggle q when a is high\n\tend\nend\n\nendmodule\n", "module top_module (\n input clk,\n input a, \n output reg q\n);\n\n always @(posedge clk) begin\n if (a) begin\n q <= ~q;\n end\n end\n\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput a, \n\toutput reg q\n);\n \n always @(posedge clk) begin\n if (a == 0) begin\n q <= q; // Retain the value when a is 0\n end else begin\n q <= ~q; // Toggle q when a is 1\n end\n end\n\nendmodule\n", "module top_module (\n input clk,\n input a, \n output reg q\n);\n \n reg [1:0] state; // Define two-state variable for state management\n\n always @(posedge clk) begin\n case (state)\n 2'b00: begin\n q <= 1'
{"task_id": "ece241_2014_q5a", "llmgen_RTL": ["module top_module (\n input clk,\n input areset,\n input x,\n output reg z\n);\n reg [1:0] state, next_state;\n reg [31:0] shift_reg; // Sufficient size for arbitrary length\n reg done;\n\n parameter IDLE = 2'b00,\n SHIFT = 2'b01,\n COMPLEMENT = 2'b10,\n DONE = 2'b11;\n\n always @(posedge clk or posedge areset) begin\n if (areset) begin\n state <= IDLE;\n shift_reg <= 0;\n done <= 0;\n z <= 0;\n end else begin\n state <= next_state;\n if (state == SHIFT) begin\n shift_reg <= {x, shift_reg[31:1]};\n end else if (state == COMPLEMENT) begin\n shift_reg <= ~shift_reg + 1;\n end else if (state == DONE) begin\n z <= shift_reg[0]; // Output least significant bit\n end\n end\n end\n\n always @(*) begin\n case (state)\n IDLE: begin\n if (!areset) begin\n next_state = SHIFT;\n end else begin\n next_state = IDLE;\n end\n end\n SHIFT: begin\n if (shift_reg[31:1] == 0) begin\n next_state = COMPLEMENT;\n end else begin\n next_state = SHIFT;\n end\n end\n COMPLEMENT: begin\n next_state = DONE;\n end\n DONE: begin\n next_state = DONE; // Wait here until reset\n end\n default: next_state = IDLE;\n endcase\n end\nendmodule\n", "module top_module (\n input clk,\n input areset,\n input x,\n output reg z\n);\n\n reg [31:0] num; // Register to store the input number\n reg [31:0] complement; // Register to store the 2's complement\n reg [5:0] count; // Counter to keep track of input bits\n\n always @(posedge clk or posedge areset) begin\n if (areset) begin\n num <= 0;\n complement <= 0;\n count <= 0;\n z <= 0;\n end else begin\n if (count < 32) begin\n num <= {x, num[31:1]}; // Shift in the new bit\n count <= count + 1;\n end else begin\n complement <= ~num + 1; // Calculate 2's complement\n z <= complement[0]; // Output the least significant bit\n end\n end\n end\n\nendmodule\n", "module top_module (\n input clk,\n input areset,\n input x,\n output reg z\n);\n reg [3:0] state;\n reg [3:0] count;\n reg [15:0] data; // Assuming max 16-bit input\n reg done;\n\n parameter IDLE = 4'b0000,\n READ = 4'b0001,\n COMPLEMENT = 4'b0010,\n OUTPUT = 4'b0011;\n\n always @(posedge clk or posedge areset) begin\n if (areset) begin\n state <= IDLE;\n count <= 0;\n data <= 0;\n z <= 0;\n done <= 0;\n end else begin\n case (state)\n IDLE: begin\n if (!areset) begin\n state <= READ;\n count <= 0;\n done <= 0;\n end\n end\n READ: begin\n if (count < 16) begin\n data[count] <= x; // Read input bit\n count <= count + 1;\n end else begin\n state <= COMPLEMENT;\n end\n end\n COMPLEMENT: begin\n data <= ~data + 1; // 2's complement\n state <= OUTPUT;\n end\n OUTPUT: begin\n z <= data[count]; // Output the most significant bit first\n if (count > 0) begin\n count <= count - 1;\n end else begin\n
{"task_id": "fsm3", "llmgen_RTL": ["module top_module (\n\tinput clk,\n\tinput in,\n\tinput areset,\n\toutput reg out\n);\n\n\ttypedef enum reg [1:0] {A, B, C, D} state_t;\n\tstate_t current_state, next_state;\n\n\talways @(posedge clk or posedge areset) begin\n\t\tif (areset) begin\n\t\t\tcurrent_state <= A;\n\t\tend else begin\n\t\t\tcurrent_state <= next_state;\n\t\tend\n\tend\n\n\talways @(*) begin\n\t\tcase (current_state)\n\t\t\tA: begin\n\t\t\t\tnext_state = (in) ? B : A;\n\t\t\t\tout = 0;\n\t\t\tend\n\t\t\tB: begin\n\t\t\t\tnext_state = (in) ? B : C;\n\t\t\t\tout = 0;\n\t\t\tend\n\t\t\tC: begin\n\t\t\t\tnext_state = (in) ? D : A;\n\t\t\t\tout = 0;\n\t\t\tend\n\t\t\tD: begin\n\t\t\t\tnext_state = (in) ? B : C;\n\t\t\t\tout = 1;\n\t\t\tend\n\t\t\tdefault: begin\n\t\t\t\tnext_state = A;\n\t\t\t\tout = 0;\n\t\t\tend\n\t\tendcase\n\tend\n\nendmodule\n", "module top_module (\n input clk,\n input in,\n input areset,\n output reg out\n);\n\n typedef enum reg [1:0] {\n A = 2'b00,\n B = 2'b01,\n C = 2'b10,\n D = 2'b11\n } state_t;\n\n state_t current_state, next_state;\n\n always @(posedge clk or posedge areset) begin\n if (areset) begin\n current_state <= A;\n end else begin\n current_state <= next_state;\n end\n end\n\n always @* begin\n case (current_state)\n A: begin\n if (in) next_state = B;\n else next_state = A;\n out = 0;\n end\n B: begin\n if (in) next_state = B;\n else next_state = C;\n out = 0;\n end\n C: begin\n if (in) next_state = D;\n else next_state = A;\n out = 0;\n end\n D: begin\n if (in) next_state = B;\n else next_state = C;\n out = 1;\n end\n default: begin\n next_state = A;\n out = 0;\n end\n endcase\n end\n\nendmodule\n", "module top_module (\n input clk,\n input in,\n input areset,\n output reg out\n);\n\n // State encoding\n typedef enum logic [1:0] {\n A = 2'b00,\n B = 2'b01,\n C = 2'b10,\n D = 2'b11\n } state_t;\n\n state_t current_state, next_state;\n\n // State transition logic\n always_ff @(posedge clk or posedge areset) begin\n if (areset) \n current_state <= A;\n else \n current_state <= next_state;\n end\n\n // Next state logic\n always_comb begin\n case (current_state)\n A: next_state = (in) ? B : A;\n B: next_state = (in) ? B : C;\n C: next_state = (in) ? D : A;\n D: next_state = (in) ? B : C;\n default: next_state = A; // Safe default\n endcase\n end\n\n // Output logic\n always_ff @(current_state) begin\n case (current_state)\n A: out = 0;\n B: out = 0;\n C: out = 0;\n D: out = 1;\n default: out = 0; // Safe default\n endcase\n end\n\nendmodule\n", "module top_module (\n input clk,\n input in,\n input areset,\n output reg out\n);\n\n typedef enum reg [1:0] {\n A = 2'b00,\n B = 2'b01,\n C = 2'b10,\n D = 2'b11\n } state_t;\n\n state_t current_state, next_state;\n\n always @(posedge clk or posedge areset) begin\n if (areset) begin\n current_state <= A;\n end else begin\n current_state <= next_state;\n end\n end\n\n always @(*) begin\n case (current_state)\n A: begin\n if (in) begin\n next_state = B;\n end else begin\n next_state = A;\n end\n out = 0;\n end\n B: begin\n if (in) begin\n next_state = B;\n end else begin\n
{"task_id": "vector2", "llmgen_RTL": ["module top_module (\n\tinput [31:0] in,\n\toutput [31:0] out\n);\n\nassign out = {in[7:0], in[15:8], in[23:16], in[31:24]};\n\nendmodule\n", "module top_module (\n\tinput [31:0] in,\n\toutput [31:0] out\n);\n\tassign out = {in[7:0], in[15:8], in[23:16], in[31:24]};\nendmodule\n", "module top_module (\n input [31:0] in,\n output [31:0] out\n);\n assign out = {in[7:0], in[15:8], in[23:16], in[31:24]};\nendmodule\n", "module top_module (\n input [31:0] in,\n output [31:0] out\n);\n assign out = {in[7:0], in[15:8], in[23:16], in[31:24]};\nendmodule\n", "module top_module (\n\tinput [31:0] in,\n\toutput [31:0] out\n);\n\n\tassign out = {in[7:0], in[15:8], in[23:16], in[31:24]};\n\nendmodule\n", "module top_module (\n\tinput [31:0] in,\n\toutput [31:0] out\n);\n\tassign out = {in[7:0], in[15:8], in[23:16], in[31:24]};\nendmodule\n", "module top_module (\n input [31:0] in,\n output [31:0] out\n);\n assign out = {in[7:0], in[15:8], in[23:16], in[31:24]};\nendmodule\n", "module top_module (\n\tinput [31:0] in,\n\toutput [31:0] out\n);\n\tassign out = {in[7:0], in[15:8], in[23:16], in[31:24]};\nendmodule\n", "module top_module (\n\tinput [31:0] in,\n\toutput [31:0] out\n);\n\tassign out = {in[7:0], in[15:8], in[23:16], in[31:24]};\nendmodule\n", "module top_module (\n input [31:0] in,\n output [31:0] out\n);\n assign out = {in[7:0], in[15:8], in[23:16], in[31:24]};\nendmodule\n", "module top_module (\n\tinput [31:0] in,\n\toutput [31:0] out\n);\n\tassign out = {in[7:0], in[15:8], in[23:16], in[31:24]};\nendmodule\n", "module top_module (\n\tinput [31:0] in,\n\toutput [31:0] out\n);\n\tassign out = {in[7:0], in[15:8], in[23:16], in[31:24]};\nendmodule\n", "module top_module (\n input [31:0] in,\n output [31:0] out\n);\n\nassign out = {in[7:0], in[15:8], in[23:16], in[31:24]};\n\nendmodule\n", "module top_module (\n input [31:0] in,\n output [31:0] out\n);\n assign out = {in[7:0], in[15:8], in[23:16], in[31:24]};\nendmodule\n", "module top_module (\n\tinput [31:0] in,\n\toutput [31:0] out\n);\n\n\tassign out = {in[7:0], in[15:8], in[23:16], in[31:24]};\n\nendmodule\n", "module top_module (\n\tinput [31:0] in,\n\toutput [31:0] out\n);\n\tassign out = {in[7:0], in[15:8], in[23:16], in[31:24]};\nendmodule\n", "module top_module (\n\tinput [31:0] in,\n\toutput [31:0] out\n);\n\tassign out = {in[7:0], in[15:8], in[23:16], in[31:24]};\nendmodule\n", "module top_module (\n input [31:0] in,\n output [31:0] out\n);\n assign out = {in[7:0], in[15:8], in[23:16], in[31:24]};\nendmodule\n", "module top_module (\n input [31:0] in,\n output [31:0] out\n);\n assign out = {in[7:0], in[15:8], in[23:16], in[31:24]};\nendmodule\n", "module top_module (\n input [31:0] in,\n output [31:0] out\n);\n\nassign out = {in[7:0], in[15:8], in[23:16], in[31:24]};\n\nendmodule\n"]}
{"task_id": "m2014_q4c", "llmgen_RTL": ["module top_module (\n input clk,\n input d,\n input r,\n output logic q\n);\n always_ff @(posedge clk or posedge r) begin\n if (r) begin\n q <= 0;\n end else begin\n q <= d;\n end\n end\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput d,\n\tinput r,\n\toutput logic q\n);\n\n\talways_ff @(posedge clk or posedge r) begin\n\t\tif (r) begin\n\t\t\tq <= 0;\n\t\tend else begin\n\t\t\tq <= d;\n\t\tend\n\tend\n\nendmodule\n", "module top_module (\n input clk,\n input d,\n input r,\n output logic q\n);\n always_ff @(posedge clk or posedge r) begin\n if (r) begin\n q <= 0;\n end else begin\n q <= d;\n end\n end\nendmodule\n", "module top_module (\n input clk,\n input d,\n input r,\n output logic q\n);\n always_ff @(posedge clk or posedge r) begin\n if (r) begin\n q <= 0;\n end else begin\n q <= d;\n end\n end\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput d,\n\tinput r,\n\toutput logic q\n);\n\talways_ff @(posedge clk or posedge r) begin\n\t\tif (r) begin\n\t\t\tq <= 0;\n\t\tend else begin\n\t\t\tq <= d;\n\t\tend\n\tend\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput d,\n\tinput r,\n\toutput logic q\n);\n\talways_ff @(posedge clk or posedge r) begin\n\t\tif (r) begin\n\t\t\tq <= 0;\n\t\tend else begin\n\t\t\tq <= d;\n\t\tend\n\tend\nendmodule\n", "module top_module (\n input clk,\n input d,\n input r,\n output logic q\n);\n\n always_ff @(posedge clk or posedge r) begin\n if (r) begin\n q <= 0;\n end else begin\n q <= d;\n end\n end\n\nendmodule\n", "module top_module (\n input clk,\n input d,\n input r,\n output logic q\n);\n always_ff @(posedge clk or posedge r) begin\n if (r) begin\n q <= 0;\n end else begin\n q <= d;\n end\n end\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput d,\n\tinput r,\n\toutput logic q\n);\nalways_ff @(posedge clk or posedge r) begin\n\tif (r) \n\t\tq <= 0;\n\telse \n\t\tq <= d;\nend\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput d,\n\tinput r,\n\toutput logic q\n);\n\talways_ff @(posedge clk or posedge r) begin\n\t\tif (r) begin\n\t\t\tq <= 0;\n\t\tend else begin\n\t\t\tq <= d;\n\t\tend\n\tend\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput d,\n\tinput r,\n\toutput logic q\n);\n\talways_ff @(posedge clk or posedge r) begin\n\t\tif (r) begin\n\t\t\tq <= 0;\n\t\tend else begin\n\t\t\tq <= d;\n\t\tend\n\tend\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput d,\n\tinput r,\n\toutput logic q\n);\n\talways_ff @(posedge clk or posedge r) begin\n\t\tif (r) \n\t\t\tq <= 0;\n\t\telse \n\t\t\tq <= d;\n\tend\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput d,\n\tinput r,\n\toutput logic q\n);\n\talways_ff @(posedge clk or posedge r) begin\n\t\tif (r) begin\n\t\t\tq <= 0;\n\t\tend else begin\n\t\t\tq <= d;\n\t\tend\n\tend\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput d,\n\tinput r,\n\toutput logic q\n);\n\n\talways_ff @(posedge clk or posedge r) begin\n\t\tif (r) begin\n\t\t\tq <= 0;\n\t\tend else begin\n\t\t\tq <= d;\n\t\tend\n\tend\n\nendmodule\n", "module top_module (\n input clk,\n input d,\n input r,\n output logic q\n);\n always_ff @(posedge clk or posedge r) begin\n if (r) begin\n q <= 0;\n end else begin\n q <= d;\n end\n end\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput d,\n\tinput r,\n\toutput logic q\n);\n\talways_ff @(posedge clk or posedge r) begin\n\t\tif (r) \n\t\t\tq <= 0;\n\t\telse \n\t\t\tq <= d;\n\tend\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput d,\n\tinput r,\n\toutput logic q\n);\n\talways_ff @(posedge clk or posedge r) begin\n\t\tif (r) begin\n\t\t\tq <= 0;\n\t\tend else begin\n\t\t\tq <= d;\n\t\tend\n\tend\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput d,\n\
{"task_id": "mt2015_q4a", "llmgen_RTL": ["module top_module(\n\tinput x,\n\tinput y,\n\toutput z\n);\n\tassign z = (x ^ y) & x;\nendmodule\n", "module top_module(\n\tinput x,\n\tinput y,\n\toutput z);\n\t\n\tassign z = (x ^ y) & x;\n\nendmodule\n", "module top_module(\n\tinput x,\n\tinput y,\n\toutput z);\n\t\n assign z = (x ^ y) & x;\n\nendmodule\n", "module top_module(\n input x,\n input y,\n output z);\n\n assign z = (x ^ y) & x;\n\nendmodule\n", "module top_module(\n input x,\n input y,\n output z\n);\n assign z = (x ^ y) & x;\nendmodule\n", "module top_module(\n input x,\n input y,\n output z\n);\n assign z = (x ^ y) & x;\nendmodule\n", "module top_module(\n input x,\n input y,\n output z\n);\n assign z = (x ^ y) & x;\nendmodule\n", "module top_module(\n input x,\n input y,\n output z\n);\n assign z = (x ^ y) & x;\nendmodule\n", "module top_module(\n\tinput x,\n\tinput y,\n\toutput z\n);\n\tassign z = (x ^ y) & x;\nendmodule\n", "module top_module(\n input x,\n input y,\n output z\n);\n assign z = (x ^ y) & x;\nendmodule\n", "module top_module(\n input x,\n input y,\n output z\n);\n assign z = (x ^ y) & x;\nendmodule\n", "module top_module(\n\tinput x,\n\tinput y,\n\toutput z\n);\n\tassign z = (x ^ y) & x;\nendmodule\n", "module top_module(\n\tinput x,\n\tinput y,\n\toutput z);\n \n assign z = (x ^ y) & x;\n\nendmodule\n", "module top_module(\n input x,\n input y,\n output z\n);\n assign z = (x ^ y) & x;\nendmodule\n", "module top_module(\n\tinput x,\n\tinput y,\n\toutput z);\n \n\tassign z = (x ^ y) & x;\n\nendmodule\n", "module top_module(\n\tinput x,\n\tinput y,\n\toutput z);\n\t\n\tassign z = (x ^ y) & x;\n\nendmodule\n", "module top_module(\n input x,\n input y,\n output z\n);\n assign z = (x ^ y) & x;\nendmodule\n", "module top_module(\n input x,\n input y,\n output z\n);\n assign z = (x ^ y) & x;\nendmodule\n", "module top_module(\n\tinput x,\n\tinput y,\n\toutput z);\n\t\n\tassign z = (x ^ y) & x;\n\nendmodule\n", "module top_module(\n\tinput x,\n\tinput y,\n\toutput z);\n\n\tassign z = (x ^ y) & x;\n\nendmodule\n"]}
{"task_id": "shift18", "llmgen_RTL": ["module top_module(\n input clk,\n input load,\n input ena,\n input [1:0] amount,\n input [63:0] data,\n output reg [63:0] q\n);\n\nalways @(posedge clk) begin\n if (load) begin\n q <= data;\n end else if (ena) begin\n case (amount)\n 2'b00: q <= {q[62:0], 1'b0}; // Shift left by 1 bit\n 2'b01: q <= {q[55:0], 8'b0}; // Shift left by 8 bits\n 2'b10: q <= {q[63], q[62:1]}; // Shift right by 1 bit (arithmetic)\n 2'b11: q <= {q[63], q[63:8]}; // Shift right by 8 bits (arithmetic)\n default: q <= q; // No operation on invalid amount\n endcase\n end\nend\n\nendmodule\n", "module top_module(\n input clk,\n input load,\n input ena,\n input [1:0] amount,\n input [63:0] data,\n output reg [63:0] q\n);\n \n always @(posedge clk) begin\n if (load) begin\n q <= data;\n end else if (ena) begin\n case (amount)\n 2'b00: q <= q << 1; // Shift left by 1 bit\n 2'b01: q <= q << 8; // Shift left by 8 bits\n 2'b10: q <= {q[62:0], q[63]}; // Arithmetic right shift by 1 bit\n 2'b11: q <= {q[55:0], q[63:56]}; // Arithmetic right shift by 8 bits\n endcase\n end\n end\n\nendmodule\n", "module top_module(\n input clk,\n input load,\n input ena,\n input [1:0] amount,\n input [63:0] data,\n output reg [63:0] q\n);\n\n always @(posedge clk) begin\n if (load) begin\n q <= data;\n end else if (ena) begin\n case (amount)\n 2'b00: q <= q << 1; // Shift left by 1 bit\n 2'b01: q <= q << 8; // Shift left by 8 bits\n 2'b10: q <= {q[62:0], q[63]}; // Arithmetic shift right by 1 bit\n 2'b11: q <= {q[63:8], q[63:56]}; // Arithmetic shift right by 8 bits\n default: q <= q; // No operation\n endcase\n end\n end\n\nendmodule\n", "module top_module(\n input clk,\n input load,\n input ena,\n input [1:0] amount,\n input [63:0] data,\n output reg [63:0] q\n);\n\nalways @(posedge clk) begin\n if (load) begin\n q <= data;\n end else if (ena) begin\n case (amount)\n 2'b00: q <= q << 1; // Shift left by 1 bit\n 2'b01: q <= q << 8; // Shift left by 8 bits\n 2'b10: q <= $signed(q) >> 1; // Arithmetic shift right by 1 bit\n 2'b11: q <= $signed(q) >> 8; // Arithmetic shift right by 8 bits\n default: q <= q; // No change\n endcase\n end\nend\n\nendmodule\n", "module top_module(\n input clk,\n input load,\n input ena,\n input [1:0] amount,\n input [63:0] data,\n output reg [63:0] q\n);\n\nalways @(posedge clk) begin\n if (load) begin\n q <= data;\n end else if (ena) begin\n case (amount)\n 2'b00: q <= q << 1; // Shift left by 1 bit\n 2'b01: q <= q << 8; // Shift left by 8 bits\n 2'b10: q <= {q[62:0], q[63]}; // Arithmetic right shift by 1 bit\n 2'b11: q <= {q[63:8], q[63:56]}; // Arithmetic right shift by 8 bits\n endcase\n end\nend\n\nendmodule\n", "module top_module(\n input clk,\n input load,\n input ena,\n input [1:0] amount,\n input [63:0] data,\n output reg [63:0] q\n);\n\n always @(posedge clk) begin\n if (load) begin\n q <= data;\n end else if (ena) begin\n case (amount)\n 2'b00: q <= q << 1; // Shift left by 1 bit\n 2'b01: q <= q << 8; // Shift left by 8 bits\n 2'b10: q <= {q[62:0], q[63]}; // Arithmetic right shift by 1 bit\n 2'b11: q <= {q[55:0], q[63:56]}; // Arithmetic right shift by 8 bits\n default: q <= q; // No operation\n endcase\n end\n end\n\nendmodul
{"task_id": "ece241_2013_q8", "llmgen_RTL": ["module top_module (\n input clk,\n input aresetn,\n input x,\n output reg z\n);\n\n // State encoding\n typedef enum reg [1:0] {S0, S1, S2} state_t;\n state_t state, next_state;\n\n always @(posedge clk or negedge aresetn) begin\n if (!aresetn)\n state <= S0;\n else\n state <= next_state;\n end\n\n always @(*) begin\n // Default assignments\n next_state = state;\n z = 1'b0;\n\n case (state)\n S0: begin\n if (x) next_state = S1;\n end\n S1: begin\n if (~x) next_state = S2;\n else next_state = S1; // Stay in S1 if x is 1\n end\n S2: begin\n if (x) begin\n next_state = S1; // Go back to S1\n z = 1'b1; // Detected \"101\"\n end else begin\n next_state = S0; // Go back to S0\n end\n end\n endcase\n end\n\nendmodule\n", "module top_module (\n input clk,\n input aresetn,\n input x,\n output reg z\n);\n // State encoding\n parameter S0 = 2'b00, // initial state\n S1 = 2'b01, // after receiving '1'\n S2 = 2'b10; // after receiving '10'\n\n reg [1:0] state, next_state;\n\n // Asynchronous reset and state update\n always @(posedge clk or negedge aresetn) begin\n if (!aresetn)\n state <= S0;\n else\n state <= next_state;\n end\n\n // Next state logic\n always @(*) begin\n case (state)\n S0: begin\n if (x)\n next_state = S1;\n else\n next_state = S0;\n z = 1'b0;\n end\n S1: begin\n if (x)\n next_state = S1; // stay in S1 on '1'\n else\n next_state = S2; // move to S2 on '0'\n z = 1'b0;\n end\n S2: begin\n if (x) begin\n next_state = S1; // move to S1 on '1'\n z = 1'b1; // '101' detected\n end\n else begin\n next_state = S0; // move back to S0 on '0'\n z = 1'b0;\n end\n end\n default: begin\n next_state = S0;\n z = 1'b0;\n end\n endcase\n end\nendmodule\n", "module top_module (\n input clk,\n input aresetn,\n input x,\n output reg z\n);\n typedef enum reg [1:0] {S0, S1, S2} state_t;\n state_t state, next_state;\n\n always @(posedge clk or negedge aresetn) begin\n if (!aresetn)\n state <= S0;\n else\n state <= next_state;\n end\n\n always @* begin\n case (state)\n S0: begin\n z = 0;\n if (x) next_state = S1;\n else next_state = S0;\n end\n S1: begin\n z = 0;\n if (x) next_state = S1; // Stay in S1 if x is 1\n else next_state = S2; // Move to S2 if x is 0\n end\n S2: begin\n z = 0;\n if (x) begin\n z = 1; // Detect \"101\"\n next_state = S1; // Overlap recognized\n end else\n next_state = S0; // Reset to S0 if x is 0\n end\n default: begin\n z = 0;\n next_state = S0; // Default to S0\n end\n endcase\n end\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput aresetn,\n\tinput x,\n\toutput reg z\n);\n\n\ttypedef enum reg [1:0] {S0, S1, S2} state_t;\n\tstate_t state, next_state;\n\n\talways @(posedge clk or negedge aresetn) begin\n\t\tif (!aresetn) \n\t\t\tstate <= S0;\n\t\telse \n\t\t\tstate <= next_state;\n\tend\n\n\talways @(state or x) begin\n\t\tz = 0; //
{"task_id": "m2014_q6", "llmgen_RTL": ["module top_module (\n input clk,\n input reset,\n input w,\n output reg z\n);\n reg [2:0] state, next_state;\n\n parameter A = 3'b000, B = 3'b001, C = 3'b010, D = 3'b011, E = 3'b100, F = 3'b101;\n\n always @(posedge clk or posedge reset) begin\n if (reset)\n state <= A;\n else\n state <= next_state;\n end\n\n always @(*) begin\n case (state)\n A: begin\n if (w == 0)\n next_state = B;\n else\n next_state = A;\n end\n B: begin\n if (w == 0)\n next_state = C;\n else\n next_state = D;\n end\n C: begin\n if (w == 0)\n next_state = E;\n else\n next_state = D;\n end\n D: begin\n if (w == 0)\n next_state = F;\n else\n next_state = A;\n end\n E: begin\n if (w == 0)\n next_state = E;\n else\n next_state = D;\n end\n F: begin\n if (w == 0)\n next_state = C;\n else\n next_state = D;\n end\n default: next_state = A;\n endcase\n end\n\n always @(posedge clk) begin\n if (state == E)\n z <= 1;\n else\n z <= 0;\n end\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput reset,\n\tinput w,\n\toutput reg z\n);\n\n\ttypedef enum reg [2:0] {\n\t\tA = 3'd0,\n\t\tB = 3'd1,\n\t\tC = 3'd2,\n\t\tD = 3'd3,\n\t\tE = 3'd4,\n\t\tF = 3'd5\n\t} state_t;\n\n\tstate_t current_state, next_state;\n\n\talways @(posedge clk or posedge reset) begin\n\t\tif (reset) \n\t\t\tcurrent_state <= A;\n\t\telse \n\t\t\tcurrent_state <= next_state;\n\tend\n\n\talways @(*) begin\n\t\tcase (current_state)\n\t\t\tA: begin\n\t\t\t\tif (w == 0)\n\t\t\t\t\tnext_state = B;\n\t\t\t\telse\n\t\t\t\t\tnext_state = A;\n\t\t\tend\n\t\t\tB: begin\n\t\t\t\tif (w == 0)\n\t\t\t\t\tnext_state = C;\n\t\t\t\telse\n\t\t\t\t\tnext_state = D;\n\t\t\tend\n\t\t\tC: begin\n\t\t\t\tif (w == 0)\n\t\t\t\t\tnext_state = E;\n\t\t\t\telse\n\t\t\t\t\tnext_state = D;\n\t\t\tend\n\t\t\tD: begin\n\t\t\t\tif (w == 0)\n\t\t\t\t\tnext_state = F;\n\t\t\t\telse\n\t\t\t\t\tnext_state = A;\n\t\t\tend\n\t\t\tE: begin\n\t\t\t\tif (w == 0)\n\t\t\t\t\tnext_state = E;\n\t\t\t\telse\n\t\t\t\t\tnext_state = D;\n\t\t\tend\n\t\t\tF: begin\n\t\t\t\tif (w == 0)\n\t\t\t\t\tnext_state = C;\n\t\t\t\telse\n\t\t\t\t\tnext_state = D;\n\t\t\tend\n\t\t\tdefault: next_state = A;\n\t\tendcase\n\tend\n\n\talways @(posedge clk or posedge reset) begin\n\t\tif (reset) \n\t\t\tz <= 0;\n\t\telse if (current_state == E)\n\t\t\tz <= 1;\n\t\telse \n\t\t\tz <= 0;\n\tend\n\nendmodule\n", "module top_module (\n input clk,\n input reset,\n input w,\n output reg z\n);\n \n typedef enum reg [2:0] {\n A = 3'b000,\n B = 3'b001,\n C = 3'b010,\n D = 3'b011,\n E = 3'b100,\n F = 3'b101\n } state_t;\n\n state_t current_state, next_state;\n\n always @(posedge clk or posedge reset) begin\n if (reset) \n current_state <= A; \n else \n current_state <= next_state; \n end\n\n always @(*) begin\n case (current_state)\n A: begin\n if (w == 0) \n next_state = B; \n else \n next_state = A; \n end\n B: begin\n if (w == 0) \n next_state = C; \n else \n next_state = D; \n end\n C: begin\n if (w == 0) \n next_state = E; \n else \n next_state = D; \n end\n D: begin\n
{"task_id": "fsm_ps2data", "llmgen_RTL": ["module top_module (\n input clk,\n input [7:0] in,\n input reset,\n output reg [23:0] out_bytes,\n output reg done\n);\n\n reg [1:0] state, next_state;\n reg [7:0] byte_count;\n\n localparam IDLE = 2'b00,\n REC1 = 2'b01,\n REC2 = 2'b10,\n REC3 = 2'b11;\n\n always @(posedge clk or posedge reset) begin\n if (reset) begin\n state <= IDLE;\n byte_count <= 0;\n out_bytes <= 24'b0;\n done <= 0;\n end else begin\n state <= next_state;\n if (next_state == REC1) begin\n out_bytes[23:16] <= in;\n byte_count <= byte_count + 1;\n end else if (next_state == REC2) begin\n out_bytes[15:8] <= in;\n byte_count <= byte_count + 1;\n end else if (next_state == REC3) begin\n out_bytes[7:0] <= in;\n done <= 1;\n byte_count <= byte_count + 1;\n end else begin\n done <= 0;\n end\n end\n end\n\n always @(*) begin\n case (state)\n IDLE: begin\n if (in[3] == 1) \n next_state = REC1;\n else \n next_state = IDLE;\n end\n REC1: begin\n next_state = REC2;\n end\n REC2: begin\n next_state = REC3;\n end\n REC3: begin\n next_state = IDLE;\n end\n default: next_state = IDLE;\n endcase\n end\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput [7:0] in,\n\tinput reset,\n\toutput reg [23:0] out_bytes,\n\toutput reg done\n);\n\n\treg [1:0] state, next_state;\n\treg [23:0] byte_buffer;\n\tparameter IDLE = 2'b00, BYTE1 = 2'b01, BYTE2 = 2'b10, BYTE3 = 2'b11;\n\n\talways @(posedge clk) begin\n\t\tif (reset) begin\n\t\t\tstate <= IDLE;\n\t\t\tout_bytes <= 24'b0;\n\t\t\tdone <= 1'b0;\n\t\t\tbyte_buffer <= 24'b0;\n\t\tend else begin\n\t\t\tstate <= next_state;\n\t\t\tif (state == BYTE1) byte_buffer[23:16] <= in;\n\t\t\telse if (state == BYTE2) byte_buffer[15:8] <= in;\n\t\t\telse if (state == BYTE3) byte_buffer[7:0] <= in;\n\t\tend\n\tend\n\n\talways @(*) begin\n\t\tnext_state = state;\n\t\tdone = 1'b0;\n\t\tcase (state)\n\t\t\tIDLE: begin\n\t\t\t\tif (in[3]) begin\n\t\t\t\t\tnext_state = BYTE1;\n\t\t\t\tend\n\t\t\tend\n\t\t\tBYTE1: begin\n\t\t\t\tnext_state = BYTE2;\n\t\t\tend\n\t\t\tBYTE2: begin\n\t\t\t\tnext_state = BYTE3;\n\t\t\tend\n\t\t\tBYTE3: begin\n\t\t\t\tnext_state = IDLE;\n\t\t\t\tdone = 1'b1;\n\t\t\t\tout_bytes = byte_buffer;\n\t\t\tend\n\t\tendcase\n\tend\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput [7:0] in,\n\tinput reset,\n\toutput reg [23:0] out_bytes,\n\toutput reg done\n);\n\ntypedef enum reg [1:0] {\n\tWAIT_FOR_START, \n\tWAIT_FOR_BYTE_2, \n\tWAIT_FOR_BYTE_3\n} state_t;\n\nstate_t state, next_state;\n\nalways @(posedge clk) begin\n\tif (reset) begin\n\t\tstate <= WAIT_FOR_START;\n\t\tout_bytes <= 24'b0;\n\t\tdone <= 0;\n\tend else begin\n\t\tstate <= next_state;\n\tend\nend\n\nalways @(state or in) begin\n\tnext_state = state;\n\tdone = 0;\n\tcase (state)\n\t\tWAIT_FOR_START: begin\n\t\t\tif (in[3] == 1) begin\n\t\t\t\tout_bytes[23:16] = in;\n\t\t\t\tnext_state = WAIT_FOR_BYTE_2;\n\t\t\tend\n\t\tend\n\t\tWAIT_FOR_BYTE_2: begin\n\t\t\tout_bytes[15:8] = in;\n\t\t\tnext_state = WAIT_FOR_BYTE_3;\n\t\tend\n\t\tWAIT_FOR_BYTE_3: begin\n\t\t\tout_bytes[7:0] = in;\n\t\t\tdone = 1;\n\t\t\tnext_state = WAIT_FOR_START; // or WAIT_FOR_START if you want to start over immediately\n\t\tend\n\tendcase\nend\n\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput [7:0] in,\n\tinput reset,\n\toutput reg [23:0] out_bytes,\n\toutput reg done\n);\n\n\ttypedef enum reg [1:0] {\n\t\tIDLE = 2'b00,\n\t\tRECEIVING = 2'b01,\n\t\tFINALIZING = 2'b10\n\t} state_t;\n\n\tstate_t current_state, next_state;\n\treg [7:0] byte_count;\n\n\talways @(posedge clk) begin\n\t
{"task_id": "2012_q2b", "llmgen_RTL": ["module top_module (\n input [5:0] y,\n input w,\n output Y1,\n output Y3\n);\n\n assign Y1 = (y[0] & ~w) | (y[1] & w) | (y[3] & ~w); // Y1 logic\n assign Y3 = (y[1] & ~w) | (y[3] & ~w) | (y[4] & w); // Y3 logic\n\nendmodule\n", "module top_module (\n input [5:0] y,\n input w,\n output Y1,\n output Y3\n);\n\n // Y1 is the input to the state flip-flop y[1] (state B)\n assign Y1 = (y[0] & ~w) | (y[1] & w) | (y[2] & w) | (y[3] & w);\n\n // Y3 is the input to the state flip-flop y[3] (state D)\n assign Y3 = (y[0] & ~w) | (y[2] & ~w) | (y[4] & ~w) | (y[5] & ~w);\n\nendmodule\n", "module top_module (\n\tinput [5:0] y,\n\tinput w,\n\toutput Y1,\n\toutput Y3\n);\n\nassign Y1 = (y[0] & ~w) | (y[1] & ~w) | (y[2] & w) | (y[3] & w) | (y[4] & ~w);\nassign Y3 = (y[0] & ~w) | (y[1] & ~w) | (y[2] & ~w) | (y[4] & w) | (y[5] & w);\n\nendmodule\n", "module top_module (\n input [5:0] y,\n input w,\n output Y1,\n output Y3\n);\n\n assign Y1 = (y[0] && w) || (y[1] && !w) || (y[4] && !w); // A -> B, B -> A, E -> D\n assign Y3 = (y[1] && w) || (y[2] && w) || (y[3] && !w); // B -> C, C -> E, D -> A\n\nendmodule\n", "module top_module (\n\tinput [5:0] y,\n\tinput w,\n\toutput Y1,\n\toutput Y3\n);\n\n\tassign Y1 = (y[0] & ~w) | (y[1] & ~w) | (y[3] & ~w) | (y[4] & w);\n\tassign Y3 = (y[1] & ~w) | (y[4] & ~w) | (y[5] & w);\n\nendmodule\n", "module top_module (\n\tinput [5:0] y,\n\tinput w,\n\toutput Y1,\n\toutput Y3\n);\n\nassign Y1 = (y[0] & ~w) | (y[1] & w) | (y[4] & ~w);\nassign Y3 = (y[1] & ~w) | (y[2] & w) | (y[3] & ~w);\n\nendmodule\n", "module top_module (\n\tinput [5:0] y,\n\tinput w,\n\toutput Y1,\n\toutput Y3\n);\n\nassign Y1 = (y[0] & ~w) | (y[1] & w) | (y[2] & ~w) | (y[3] & ~w) | (y[4] & ~w);\nassign Y3 = (y[0] & ~w) | (y[1] & ~w) | (y[2] & w) | (y[3] & ~w) | (y[4] & ~w) | (y[5] & ~w);\n\nendmodule\n", "module top_module (\n input [5:0] y,\n input w,\n output Y1,\n output Y3\n);\n\n assign Y1 = (y[1] & ~w) | (y[0] & w); // Transitions to state B\n assign Y3 = (y[3] & ~w) | (y[2] & w); // Transitions to state D\n\nendmodule\n", "module top_module (\n input [5:0] y,\n input w,\n output Y1,\n output Y3\n);\n\n assign Y1 = (y[1] & ~w) | (y[0] & w) | (y[3] & ~w) | (y[5] & ~w); // Y1 input logic\n assign Y3 = (y[1] & ~w) | (y[2] & ~w) | (y[3] & w) | (y[4] & w); // Y3 input logic\n\nendmodule\n", "module top_module (\n input [5:0] y,\n input w,\n output Y1,\n output Y3\n);\n\n assign Y1 = (y[0] & ~w) | (y[1] & ~w) | (y[3] & w);\n assign Y3 = (y[1] & w) | (y[3] & ~w) | (y[5] & ~w);\n\nendmodule\n", "module top_module (\n input [5:0] y,\n input w,\n output Y1,\n output Y3\n);\n\nassign Y1 = (y[0] & ~w) | (y[1] & w) | (y[4] & ~w) | (y[5] & ~w);\nassign Y3 = (y[1] & ~w) | (y[2] & w) | (y[3] & w);\n\nendmodule\n", "module top_module (\n input [5:0] y,\n input w,\n output Y1,\n output Y3\n);\n\nassign Y1 = (y[0] & ~w) | (y[1] & ~w) | (y[2] & ~w) | (y[3] & ~w) | (y[4] & w); // From states A, B, C, D, E to next state for y[1]\nassign Y3 = (y[0] & ~w) | (y[1] & w) | (y[3] & w) | (y[4] & ~w); // From states A, B, D, E to next state for y[3]\n\nendmodule\n", "module top_module (\n input [5:0] y,\n input w,\n output Y1,\n output Y3\n);\n\n assign Y1 = (y[0] & ~w) | (y[1] & w) | (y[2] & ~w) | (y[3] & ~w) | (y[4] & ~w);\n assign Y3 = (y[0] & ~w) | (y[1] & ~w) | (y[2] & w) | (y[3] & ~w) | (y[4] & ~w);\n\nendmodule\n", "module top_module (\n input [5:0] y,\n input w,\n output Y1,\n output Y3\n);\n\n assign Y1 = (y[0] & ~w) | (y[1] & ~w) | (y[2] & ~w) | (y[3] & ~w) | (y[4] & ~w) | (y[5] & w);\n assign Y3 = (y[1] & ~w) | (y[3] & ~w) | (y[4] & w);\n\nendmodule\n", "module top_module (\n input [5:0] y,\n input w,\n output Y1,\n output Y3\n);\n\nassign Y1 = (y[1] & ~w) | (y[0] & w); // State B to D (0) or A (1) to B (1)\nassign Y3 = (y[2] & ~w) | (y[3] & (w | ~y[0])); // State C to E (1) or D (0) to A (0)\n\nendmodule\n", "module top_module (
{"task_id": "vector0", "llmgen_RTL": ["module top_module(\n\tinput [2:0] vec, \n\toutput [2:0] outv,\n\toutput o2,\n\toutput o1,\n\toutput o0\n);\n\tassign outv = vec;\n\tassign o2 = vec[2];\n\tassign o1 = vec[1];\n\tassign o0 = vec[0];\nendmodule\n", "module top_module(\n\tinput [2:0] vec, \n\toutput [2:0] outv,\n\toutput o2,\n\toutput o1,\n\toutput o0\n);\n\nassign outv = vec;\nassign o2 = vec[2];\nassign o1 = vec[1];\nassign o0 = vec[0];\n\nendmodule\n", "module top_module(\n input [2:0] vec, \n output [2:0] outv,\n output o2,\n output o1,\n output o0\n);\n assign outv = vec;\n assign o2 = vec[2];\n assign o1 = vec[1];\n assign o0 = vec[0];\nendmodule\n", "module top_module(\n\tinput [2:0] vec, \n\toutput [2:0] outv,\n\toutput o2,\n\toutput o1,\n\toutput o0\n);\n\tassign outv = vec; \n\tassign o2 = vec[2];\n\tassign o1 = vec[1];\n\tassign o0 = vec[0];\nendmodule\n", "module top_module(\n\tinput [2:0] vec, \n\toutput [2:0] outv,\n\toutput o2,\n\toutput o1,\n\toutput o0\n);\n\nassign outv = vec;\nassign o2 = vec[2];\nassign o1 = vec[1];\nassign o0 = vec[0];\n\nendmodule\n", "module top_module(\n\tinput [2:0] vec, \n\toutput [2:0] outv,\n\toutput o2,\n\toutput o1,\n\toutput o0\n);\n\tassign outv = vec;\n\tassign o2 = vec[2];\n\tassign o1 = vec[1];\n\tassign o0 = vec[0];\nendmodule\n", "module top_module(\n input [2:0] vec, \n output [2:0] outv,\n output o2,\n output o1,\n output o0\n);\n assign outv = vec;\n assign o2 = vec[2];\n assign o1 = vec[1];\n assign o0 = vec[0];\nendmodule\n", "module top_module(\n\tinput [2:0] vec, \n\toutput [2:0] outv,\n\toutput o2,\n\toutput o1,\n\toutput o0\n);\n\nassign outv = vec;\nassign o2 = vec[2];\nassign o1 = vec[1];\nassign o0 = vec[0];\n\nendmodule\n", "module top_module(\n\tinput [2:0] vec, \n\toutput [2:0] outv,\n\toutput o2,\n\toutput o1,\n\toutput o0\n);\n\nassign outv = vec;\nassign o2 = vec[2];\nassign o1 = vec[1];\nassign o0 = vec[0];\n\nendmodule\n", "module top_module(\n input [2:0] vec, \n output [2:0] outv,\n output o2,\n output o1,\n output o0\n);\n assign outv = vec;\n assign o2 = vec[2];\n assign o1 = vec[1];\n assign o0 = vec[0];\nendmodule\n", "module top_module(\n\tinput [2:0] vec, \n\toutput [2:0] outv,\n\toutput o2,\n\toutput o1,\n\toutput o0\n);\n\nassign outv = vec;\nassign o2 = vec[2];\nassign o1 = vec[1];\nassign o0 = vec[0];\n\nendmodule\n", "module top_module(\n input [2:0] vec, \n output [2:0] outv,\n output o2,\n output o1,\n output o0\n);\n assign outv = vec;\n assign o2 = vec[2];\n assign o1 = vec[1];\n assign o0 = vec[0];\nendmodule\n", "module top_module(\n\tinput [2:0] vec, \n\toutput [2:0] outv,\n\toutput o2,\n\toutput o1,\n\toutput o0\n);\n\nassign outv = vec;\nassign o2 = vec[2];\nassign o1 = vec[1];\nassign o0 = vec[0];\n\nendmodule\n", "module top_module(\n\tinput [2:0] vec, \n\toutput [2:0] outv,\n\toutput o2,\n\toutput o1,\n\toutput o0\n);\n\tassign outv = vec;\n\tassign o2 = vec[2];\n\tassign o1 = vec[1];\n\tassign o0 = vec[0];\nendmodule\n", "module top_module(\n\tinput [2:0] vec, \n\toutput [2:0] outv,\n\toutput o2,\n\toutput o1,\n\toutput o0\n);\n\tassign outv = vec;\n\tassign o2 = vec[2];\n\tassign o1 = vec[1];\n\tassign o0 = vec[0];\nendmodule\n", "module top_module(\n\tinput [2:0] vec, \n\toutput [2:0] outv,\n\toutput o2,\n\toutput o1,\n\toutput o0\n);\n\tassign outv = vec;\n\tassign o2 = vec[2];\n\tassign o1 = vec[1];\n\tassign o0 = vec[0];\nendmodule\n", "module top_module(\n\tinput [2:0] vec, \n\toutput [2:0] outv,\n\toutput o2,\n\toutput o1,\n\toutput o0\n);\n\nassign outv = vec;\nassign o0 = vec[0];\nassign o1 = vec[1];\nassign o2 = vec[2];\n\nendmodule\n", "module top_module(\n\tinput [2:0] vec, \n\toutput [2:0] outv,\n\toutput o2,\n\toutput o1,\n\toutput o0\n);\n\tassign outv = vec;\n\tassign o2 = vec[2];\n\tassign o1 = vec[1];\n\tassign o0 = vec[0];\nendmodule\n", "module top_module(\n\tinput [2:0] vec, \n\toutput [2:0] outv,\n\toutput o2,\n\toutput o1,\n\toutput o0\n);\n\tassign outv = vec;\n\tassign o2 = vec[2];\n\tassi
{"task_id": "kmap4", "llmgen_RTL": ["module top_module (\n\tinput a, \n\tinput b,\n\tinput c,\n\tinput d,\n\toutput reg out\n);\n\nalways @(*) begin\n\tcase({a, b, c, d})\n\t\t4'b0000: out = 0;\n\t\t4'b0001: out = 1;\n\t\t4'b0010: out = 1;\n\t\t4'b0011: out = 0;\n\t\t4'b0100: out = 1;\n\t\t4'b0101: out = 0;\n\t\t4'b0110: out = 0;\n\t\t4'b0111: out = 1;\n\t\t4'b1000: out = 1;\n\t\t4'b1001: out = 0;\n\t\t4'b1010: out = 0;\n\t\t4'b1011: out = 1;\n\t\t4'b1100: out = 0;\n\t\t4'b1101: out = 1;\n\t\t4'b1110: out = 1;\n\t\t4'b1111: out = 0;\n\t\tdefault: out = 0;\n\tendcase\nend\n\nendmodule\n", "module top_module (\n\tinput a, \n\tinput b,\n\tinput c,\n\tinput d,\n\toutput reg out\n);\n\talways @* begin\n\t\tcase ({d, c, b, a})\n\t\t\t4'b0000: out = 0;\n\t\t\t4'b0001: out = 1;\n\t\t\t4'b0010: out = 0;\n\t\t\t4'b0011: out = 1;\n\t\t\t4'b0100: out = 1;\n\t\t\t4'b0101: out = 0;\n\t\t\t4'b0110: out = 1;\n\t\t\t4'b0111: out = 0;\n\t\t\t4'b1000: out = 1;\n\t\t\t4'b1001: out = 0;\n\t\t\t4'b1010: out = 1;\n\t\t\t4'b1011: out = 0;\n\t\t\t4'b1100: out = 0;\n\t\t\t4'b1101: out = 1;\n\t\t\t4'b1110: out = 0;\n\t\t\t4'b1111: out = 1;\n\t\t\tdefault: out = 0;\n\t\tendcase\n\tend\nendmodule\n", "module top_module (\n\tinput a, \n\tinput b,\n\tinput c,\n\tinput d,\n\toutput reg out\n);\n\n\talways @(*) begin\n\t\tcase ({a, b, c, d})\n\t\t\t4'b0000: out = 0;\n\t\t\t4'b0001: out = 1;\n\t\t\t4'b0010: out = 1;\n\t\t\t4'b0011: out = 0;\n\t\t\t4'b0100: out = 1;\n\t\t\t4'b0101: out = 0;\n\t\t\t4'b0110: out = 0;\n\t\t\t4'b0111: out = 1;\n\t\t\t4'b1000: out = 1;\n\t\t\t4'b1001: out = 0;\n\t\t\t4'b1010: out = 1;\n\t\t\t4'b1011: out = 0;\n\t\t\t4'b1100: out = 0;\n\t\t\t4'b1101: out = 1;\n\t\t\t4'b1110: out = 1;\n\t\t\t4'b1111: out = 0;\n\t\t\tdefault: out = 0;\n\t\tendcase\n\tend\n\nendmodule\n", "module top_module (\n\tinput a, \n\tinput b,\n\tinput c,\n\tinput d,\n\toutput reg out\n);\n\talways @(*) begin\n\t\tcase ({c, d, b, a})\n\t\t\t4'b0000: out = 0;\n\t\t\t4'b0001: out = 1;\n\t\t\t4'b0010: out = 0;\n\t\t\t4'b0011: out = 1;\n\t\t\t4'b0100: out = 1;\n\t\t\t4'b0101: out = 0;\n\t\t\t4'b0110: out = 1;\n\t\t\t4'b0111: out = 0;\n\t\t\t4'b1000: out = 1;\n\t\t\t4'b1001: out = 0;\n\t\t\t4'b1010: out = 1;\n\t\t\t4'b1011: out = 0;\n\t\t\t4'b1100: out = 0;\n\t\t\t4'b1101: out = 1;\n\t\t\t4'b1110: out = 0;\n\t\t\t4'b1111: out = 1;\n\t\t\tdefault: out = 0;\n\t\tendcase\n\tend\nendmodule\n", "module top_module (\n\tinput a, \n\tinput b,\n\tinput c,\n\tinput d,\n\toutput reg out\n);\n\talways @(*) begin\n\t\tcase ({c, d, b, a})\n\t\t\t4'b0000: out = 0; // 00 00\n\t\t\t4'b0001: out = 1; // 00 01\n\t\t\t4'b0010: out = 0; // 00 10\n\t\t\t4'b0011: out = 1; // 00 11\n\t\t\t4'b0100: out = 1; // 01 00\n\t\t\t4'b0101: out = 0; // 01 01\n\t\t\t4'b0110: out = 1; // 01 10\n\t\t\t4'b0111: out = 0; // 01 11\n\t\t\t4'b1000: out = 0; // 10 00\n\t\t\t4'b1001: out = 1; // 10 01\n\t\t\t4'b1010: out = 0; // 10 10\n\t\t\t4'b1011: out = 1; // 10 11\n\t\t\t4'b1100: out = 1; // 11 00\n\t\t\t4'b1101: out = 0; // 11 01\n\t\t\t4'b1110: out = 1; // 11 10\n\t\t\t4'b1111: out = 0; // 11 11\n\t\t\tdefault: out = 0; // Default case\n\t\tendcase\n\tend\nendmodule\n", "module top_module (\n\tinput a, \n\tinput b,\n\tinput c,\n\tinput d,\n\toutput reg out\n);\n\talways @(*) begin\n\t\tcase ({c, d, b, a})\n\t\t\t4'b0000: out = 0; // (0, 0) -> 0\n\t\t\t4'b0001: out = 1; // (0, 1) -> 1\n\t\t\t4'b0011: out = 0; // (1, 1) -> 0\n\t\t\t4'b0010: out = 1; // (1, 0) -> 1\n\t\t\t4'b0100: out = 1; // (0, 0) -> 1\n\t\t\t4'b0101: out = 0; // (0, 1) -> 0\n\t\t\t4'b0111: out = 0; // (1, 1) -> 0\n\t\t\t4'b0110: out = 1; // (1, 0) -> 1\n\t\t\t4'b1000: out = 0; // (0, 0) -> 0\n\t\t\t4'b1001: out = 1; // (0, 1) -> 1\n\t\t\t4'b1011: out = 0; // (1, 1) -> 0\n\t\t\t4'b1010: out = 1; // (1, 0) -> 1\n\t\t\t4'b1100: out = 1; // (0, 0) -> 1\n\t\t\t4'b1101: out = 0; // (0, 1) -> 0\n\t\t\t4'b1111: out = 0; // (1, 1) -> 0\n\t\t\t4'b1110: out = 1; // (1, 0) -> 1\n\t\t\tdefault: out = 0;\n\t\tendcase\n\tend\nendmodule\n", "module top_module (\n\tinput a, \n\tinput b,\n\tinput c,\n\tinput d,\n\toutput reg out\n);\n\talways @(*) b
{"task_id": "vector1", "llmgen_RTL": ["module top_module (\n\tinput [15:0] in,\n\toutput [7:0] out_hi,\n\toutput [7:0] out_lo\n);\n\nassign out_lo = in[7:0];\nassign out_hi = in[15:8];\n\nendmodule\n", "module top_module (\n input [15:0] in,\n output [7:0] out_hi,\n output [7:0] out_lo\n);\n assign out_lo = in[7:0];\n assign out_hi = in[15:8];\nendmodule\n", "module top_module (\n\tinput [15:0] in,\n\toutput [7:0] out_hi,\n\toutput [7:0] out_lo\n);\n\tassign out_lo = in[7:0];\n\tassign out_hi = in[15:8];\nendmodule\n", "module top_module (\n\tinput [15:0] in,\n\toutput [7:0] out_hi,\n\toutput [7:0] out_lo\n);\n\n\tassign out_lo = in[7:0];\n\tassign out_hi = in[15:8];\n\nendmodule\n", "module top_module (\n\tinput [15:0] in,\n\toutput [7:0] out_hi,\n\toutput [7:0] out_lo\n);\n\tassign out_lo = in[7:0];\n\tassign out_hi = in[15:8];\nendmodule\n", "module top_module (\n\tinput [15:0] in,\n\toutput [7:0] out_hi,\n\toutput [7:0] out_lo\n);\n\n\tassign out_lo = in[7:0];\n\tassign out_hi = in[15:8];\n\nendmodule\n", "module top_module (\n\tinput [15:0] in,\n\toutput [7:0] out_hi,\n\toutput [7:0] out_lo\n);\n\tassign out_lo = in[7:0];\n\tassign out_hi = in[15:8];\nendmodule\n", "module top_module (\n\tinput [15:0] in,\n\toutput [7:0] out_hi,\n\toutput [7:0] out_lo\n);\n\nassign out_lo = in[7:0];\nassign out_hi = in[15:8];\n\nendmodule\n", "module top_module (\n input [15:0] in,\n output [7:0] out_hi,\n output [7:0] out_lo\n);\n assign out_lo = in[7:0];\n assign out_hi = in[15:8];\nendmodule\n", "module top_module (\n input [15:0] in,\n output [7:0] out_hi,\n output [7:0] out_lo\n);\n assign out_lo = in[7:0];\n assign out_hi = in[15:8];\nendmodule\n", "module top_module (\n input [15:0] in,\n output [7:0] out_hi,\n output [7:0] out_lo\n);\n assign out_lo = in[7:0];\n assign out_hi = in[15:8];\nendmodule\n", "module top_module (\n\tinput [15:0] in,\n\toutput [7:0] out_hi,\n\toutput [7:0] out_lo\n);\n\n\tassign out_lo = in[7:0];\n\tassign out_hi = in[15:8];\n\nendmodule\n", "module top_module (\n\tinput [15:0] in,\n\toutput [7:0] out_hi,\n\toutput [7:0] out_lo\n);\n\tassign out_lo = in[7:0];\n\tassign out_hi = in[15:8];\nendmodule\n", "module top_module (\n\tinput [15:0] in,\n\toutput [7:0] out_hi,\n\toutput [7:0] out_lo\n);\n\tassign out_lo = in[7:0];\n\tassign out_hi = in[15:8];\nendmodule\n", "module top_module (\n\tinput [15:0] in,\n\toutput [7:0] out_hi,\n\toutput [7:0] out_lo\n);\n\n\tassign out_lo = in[7:0];\n\tassign out_hi = in[15:8];\n\nendmodule\n", "module top_module (\n input [15:0] in,\n output [7:0] out_hi,\n output [7:0] out_lo\n);\n\nassign out_lo = in[7:0];\nassign out_hi = in[15:8];\n\nendmodule\n", "module top_module (\n\tinput [15:0] in,\n\toutput [7:0] out_hi,\n\toutput [7:0] out_lo\n);\n\n\tassign out_lo = in[7:0];\n\tassign out_hi = in[15:8];\n\nendmodule\n", "module top_module (\n input [15:0] in,\n output [7:0] out_hi,\n output [7:0] out_lo\n);\n assign out_lo = in[7:0];\n assign out_hi = in[15:8];\nendmodule\n", "module top_module (\n input [15:0] in,\n output [7:0] out_hi,\n output [7:0] out_lo\n);\n assign out_lo = in[7:0];\n assign out_hi = in[15:8];\nendmodule\n", "module top_module (\n\tinput [15:0] in,\n\toutput [7:0] out_hi,\n\toutput [7:0] out_lo\n);\n\tassign out_lo = in[7:0];\n\tassign out_hi = in[15:8];\nendmodule\n"]}
{"task_id": "norgate", "llmgen_RTL": ["module top_module(\n\tinput a, \n\tinput b,\n\toutput out\n);\n\tassign out = ~(a | b);\nendmodule\n", "module top_module(\n input a, \n input b,\n output out\n);\n assign out = ~(a | b);\nendmodule\n", "module top_module(\n\tinput a, \n\tinput b,\n\toutput out\n);\n\tassign out = ~(a | b);\nendmodule\n", "module top_module(\n input a, \n input b,\n output out\n);\n assign out = ~(a | b);\nendmodule\n", "module top_module(\n input a, \n input b,\n output out\n);\n assign out = ~(a | b);\nendmodule\n", "module top_module(\n input a, \n input b,\n output out\n);\n assign out = ~(a | b);\nendmodule\n", "module top_module(\n\tinput a, \n\tinput b,\n\toutput out\n);\n\tassign out = ~(a | b);\nendmodule\n", "module top_module(\n\tinput a, \n\tinput b,\n\toutput out\n);\n\nassign out = ~(a | b);\n\nendmodule\n", "module top_module(\n input a, \n input b,\n output out\n);\n assign out = ~(a | b);\nendmodule\n", "module top_module(\n\tinput a, \n\tinput b,\n\toutput out\n);\n\tassign out = ~(a | b);\nendmodule\n", "module top_module(\n\tinput a, \n\tinput b,\n\toutput out\n);\n\tassign out = ~(a | b);\nendmodule\n", "module top_module(\n input a, \n input b,\n output out\n);\n assign out = ~(a | b);\nendmodule\n", "module top_module(\n\tinput a, \n\tinput b,\n\toutput out\n);\n\tassign out = ~(a | b);\nendmodule\n", "module top_module(\n\tinput a, \n\tinput b,\n\toutput out\n);\n\tassign out = ~(a | b);\nendmodule\n", "module top_module(\n\tinput a, \n\tinput b,\n\toutput out\n);\n\tassign out = ~(a | b);\nendmodule\n", "module top_module(\n\tinput a, \n\tinput b,\n\toutput out\n);\n\tassign out = ~(a | b);\nendmodule\n", "module top_module(\n input a, \n input b,\n output out\n);\n assign out = ~(a | b);\nendmodule\n", "module top_module(\n\tinput a, \n\tinput b,\n\toutput out\n);\nassign out = ~(a | b);\nendmodule\n", "module top_module(\n\tinput a, \n\tinput b,\n\toutput out\n);\n\tassign out = ~(a | b);\nendmodule\n", "module top_module(\n\tinput a, \n\tinput b,\n\toutput out\n);\n\tassign out = ~(a | b);\nendmodule\n"]}
{"task_id": "alwaysblock2", "llmgen_RTL": ["module top_module(\n input clk,\n input a, \n input b,\n output out_assign,\n output reg out_always_comb,\n output reg out_always_ff\n);\n\nassign out_assign = a ^ b;\n\nalways @* begin\n out_always_comb = a ^ b;\nend\n\nalways @(posedge clk) begin\n out_always_ff <= a ^ b;\nend\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput a, \n\tinput b,\n\toutput out_assign,\n\toutput reg out_always_comb,\n\toutput reg out_always_ff\n);\n\nassign out_assign = a ^ b;\n\nalways @(*) begin\n out_always_comb = a ^ b;\nend\n\nalways @(posedge clk) begin\n out_always_ff <= a ^ b;\nend\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput a, \n\tinput b,\n\toutput out_assign,\n\toutput reg out_always_comb,\n\toutput reg out_always_ff\n);\n\nassign out_assign = a ^ b;\n\nalways @* begin\n\tout_always_comb = a ^ b;\nend\n\nalways @(posedge clk) begin\n\tout_always_ff <= a ^ b;\nend\n\nendmodule\n", "module top_module(\n input clk,\n input a, \n input b,\n output out_assign,\n output reg out_always_comb,\n output reg out_always_ff\n);\n\nassign out_assign = a ^ b;\n\nalways @* begin\n out_always_comb = a ^ b;\nend\n\nalways @(posedge clk) begin\n out_always_ff <= a ^ b;\nend\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput a, \n\tinput b,\n\toutput out_assign,\n\toutput reg out_always_comb,\n\toutput reg out_always_ff\n);\n\nassign out_assign = a ^ b;\n\nalways @* begin\n out_always_comb = a ^ b;\nend\n\nalways @(posedge clk) begin\n out_always_ff <= a ^ b;\nend\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput a, \n\tinput b,\n\toutput out_assign,\n\toutput reg out_always_comb,\n\toutput reg out_always_ff\n);\n\nassign out_assign = a ^ b;\n\nalways @(*) begin\n out_always_comb = a ^ b;\nend\n\nalways @(posedge clk) begin\n out_always_ff <= a ^ b;\nend\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput a, \n\tinput b,\n\toutput out_assign,\n\toutput reg out_always_comb,\n\toutput reg out_always_ff\n);\n \n// XOR gate using assign statement\nassign out_assign = a ^ b;\n\n// Combinational always block\nalways @(*) begin\n\tout_always_comb = a ^ b;\nend\n\n// Clocked always block\nalways @(posedge clk) begin\n\tout_always_ff <= a ^ b;\nend\n\nendmodule\n", "module top_module(\n input clk,\n input a, \n input b,\n output out_assign,\n output reg out_always_comb,\n output reg out_always_ff\n);\n\n assign out_assign = a ^ b;\n\n always @* begin\n out_always_comb = a ^ b;\n end\n\n always @(posedge clk) begin\n out_always_ff <= a ^ b;\n end\n\nendmodule\n", "module top_module(\n input clk,\n input a, \n input b,\n output out_assign,\n output reg out_always_comb,\n output reg out_always_ff\n);\n\nassign out_assign = a ^ b;\n\nalways @* begin\n out_always_comb = a ^ b;\nend\n\nalways @(posedge clk) begin\n out_always_ff <= a ^ b;\nend\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput a, \n\tinput b,\n\toutput out_assign,\n\toutput reg out_always_comb,\n\toutput reg out_always_ff\n);\n\n\tassign out_assign = a ^ b;\n\n\talways @(*) begin\n\t\tout_always_comb = a ^ b;\n\tend\n\n\talways @(posedge clk) begin\n\t\tout_always_ff <= a ^ b;\n\tend\n\nendmodule\n", "module top_module(\n input clk,\n input a, \n input b,\n output out_assign,\n output reg out_always_comb,\n output reg out_always_ff\n);\n\n assign out_assign = a ^ b;\n\n always @(*) begin\n out_always_comb = a ^ b;\n end\n\n always @(posedge clk) begin\n out_always_ff <= a ^ b;\n end\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput a, \n\tinput b,\n\toutput out_assign,\n\toutput reg out_always_comb,\n\toutput reg out_always_ff\n);\n\nassign out_assign = a ^ b;\n\nalways @(*) begin\n out_always_comb = a ^ b;\nend\n\nalways @(posedge clk) begin\n out_always_ff <= a ^ b;\nend\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput a, \n\tinput b,\n\toutput out_assign,\n\toutput reg out_always_co
{"task_id": "m2014_q6c", "llmgen_RTL": ["module top_module (\n\tinput [6:1] y,\n\tinput w,\n\toutput Y2,\n\toutput Y4\n);\n\nassign Y2 = (y[6] & ~w) | (y[5] & ~w) | (y[4] & ~w) | (y[3] & ~w) | (y[2] & w);\nassign Y4 = (y[4] & ~w) | (y[3] & ~w) | (y[2] & w) | (y[1] & ~w);\n\nendmodule\n", "module top_module (\n input [6:1] y,\n input w,\n output Y2,\n output Y4\n);\n\n assign Y2 = (y[5] & ~w) | (y[6] & ~w); // B(0) --0--> C, D(0) --1--> A\n assign Y4 = (y[4] & w) | (y[6] & w); // E(1) --0--> E, D(0) --1--> A\n\nendmodule\n", "module top_module (\n\tinput [6:1] y,\n\tinput w,\n\toutput Y2,\n\toutput Y4\n);\n\nassign Y2 = (y[4] & ~w) | (y[5] & w) | (y[6] & ~w);\nassign Y4 = (y[2] & w) | (y[3] & w) | (y[5] & w);\n\nendmodule\n", "module top_module (\n\tinput [6:1] y,\n\tinput w,\n\toutput Y2,\n\toutput Y4\n);\n\nassign Y2 = (y[3] & ~w) | (y[4] & ~w) | (y[6] & ~w); // B, C, F\nassign Y4 = (y[5] & w) | (y[6] & ~w); // E, F\n\nendmodule\n", "module top_module (\n\tinput [6:1] y,\n\tinput w,\n\toutput Y2,\n\toutput Y4\n);\n\nassign Y2 = (y[3] & ~w) | (y[4] & ~w) | (y[5] & w); // Next-state logic for Y2\nassign Y4 = (y[2] & ~w) | (y[4] & w) | (y[6] & ~w); // Next-state logic for Y4\n\nendmodule\n", "module top_module (\n\tinput [6:1] y,\n\tinput w,\n\toutput Y2,\n\toutput Y4\n);\n\nassign Y2 = (y[5] & ~w) | (y[4] & ~w) | (y[6] & ~w); // B(0->C), C(0->D), E(1->D)\nassign Y4 = (y[2] & w) | (y[3] & ~w) | (y[6] & ~w); // A(1->A), D(0->D), F(1->D)\n\nendmodule\n", "module top_module (\n input [6:1] y,\n input w,\n output Y2,\n output Y4\n);\n\n // Next-state logic for Y2\n assign Y2 = (y[4] & ~w) | (y[5] & ~w) | (y[6] & ~w);\n\n // Next-state logic for Y4\n assign Y4 = (y[5] & w) | (y[6] & w);\n\nendmodule\n", "module top_module (\n input [6:1] y,\n input w,\n output Y2,\n output Y4\n);\n\nassign Y2 = (y[6] & ~w) | (y[4] & ~w) | (y[5] & w); // Y2 logic derived by inspection\nassign Y4 = (y[5] & ~w) | (y[3] & w); // Y4 logic derived by inspection\n\nendmodule\n", "module top_module (\n\tinput [6:1] y,\n\tinput w,\n\toutput Y2,\n\toutput Y4\n);\n\nassign Y2 = (y[4] & ~w) | (y[5] & ~w) | (y[6] & ~w); // States B, C, D -> E or D\nassign Y4 = (y[3] & ~w) | (y[5] & w) | (y[6] & w); // States C, E, F -> D or C\n\nendmodule\n", "module top_module (\n input [6:1] y,\n input w,\n output Y2,\n output Y4\n);\n\nassign Y2 = (y[3] & ~w) | (y[4] & ~w) | (y[6] & ~w); // Next-state signal for y[2]\nassign Y4 = (y[6] & w) | (y[5] & w); // Next-state signal for y[4]\n\nendmodule\n", "module top_module (\n input [6:1] y,\n input w,\n output Y2,\n output Y4\n);\n\n assign Y2 = (y[6] & w) | (y[5] & ~w) | (y[4] & ~w) | (y[3] & ~w); // States A, B, C\n assign Y4 = (y[5] & w) | (y[4] & ~w) | (y[3] & w) | (y[2] & ~w); // States B, C, D, E\n\nendmodule\n", "module top_module (\n input [6:1] y,\n input w,\n output Y2,\n output Y4\n);\n\nassign Y2 = (y[5] & ~w) | (y[6] & ~w) | (y[4] & w);\nassign Y4 = (y[3] & ~w) | (y[4] & ~w) | (y[6] & w);\n\nendmodule\n", "module top_module (\n input [6:1] y,\n input w,\n output Y2,\n output Y4\n);\n\n // Next-state logic for Y2\n assign Y2 = (y[5] & ~w) | (y[6] & w) | (y[4] & w) | (y[3] & w); // From states B, C, D, F\n\n // Next-state logic for Y4\n assign Y4 = (y[1] & ~w) | (y[3] & ~w) | (y[5] & w); // From states A, C, E\n\nendmodule\n", "module top_module (\n\tinput [6:1] y,\n\tinput w,\n\toutput Y2,\n\toutput Y4\n);\n\n\tassign Y2 = (y[5] & ~w) | (y[6] & w) | (y[4] & ~w);\n\tassign Y4 = (y[3] & w) | (y[5] & ~w) | (y[2] & w);\n\nendmodule\n", "module top_module (\n input [6:1] y,\n input w,\n output Y2,\n output Y4\n);\n\n // Y2 logic (Next State for output y[2] when w is input)\n assign Y2 = (y[2] & (w == 1'b1)) | (y[4] & (w == 1'b0));\n\n // Y4 logic (Next State for output y[4] when w is input)\n assign Y4 = (y[1] & (w == 1'b1)) | (y[3] & (w == 1'b0)) | (y[5] & (w == 1'b1));\n\nendmodule\n", "module top_module (\n\tinput [6:1] y,\n\tinput w,\n\toutput Y2,\n\toutput Y4\n);\n
{"task_id": "mux256to1", "llmgen_RTL": ["module top_module (\n input [255:0] in,\n input [7:0] sel,\n output out\n);\n assign out = in[sel];\nendmodule\n", "module top_module (\n\tinput [255:0] in,\n\tinput [7:0] sel,\n\toutput out\n);\n\tassign out = in[sel];\nendmodule\n", "module top_module (\n input [255:0] in,\n input [7:0] sel,\n output out\n);\n assign out = in[sel];\nendmodule\n", "module top_module (\n\tinput [255:0] in,\n\tinput [7:0] sel,\n\toutput out\n);\n\tassign out = in[sel];\nendmodule\n", "module top_module (\n\tinput [255:0] in,\n\tinput [7:0] sel,\n\toutput out\n);\n\tassign out = in[sel];\nendmodule\n", "module top_module (\n\tinput [255:0] in,\n\tinput [7:0] sel,\n\toutput out\n);\n\tassign out = in[sel];\nendmodule\n", "module top_module (\n\tinput [255:0] in,\n\tinput [7:0] sel,\n\toutput out\n);\n\tassign out = in[sel];\nendmodule\n", "module top_module (\n input [255:0] in,\n input [7:0] sel,\n output out\n);\n assign out = in[sel];\nendmodule\n", "module top_module (\n\tinput [255:0] in,\n\tinput [7:0] sel,\n\toutput reg out\n);\n\talways @(*) begin\n\t\tout = in[sel];\n\tend\nendmodule\n", "module top_module (\n input [255:0] in,\n input [7:0] sel,\n output out\n);\n assign out = in[sel];\nendmodule\n", "module top_module (\n\tinput [255:0] in,\n\tinput [7:0] sel,\n\toutput out\n);\n\tassign out = in[sel];\nendmodule\n", "module top_module (\n input [255:0] in,\n input [7:0] sel,\n output out\n);\n assign out = in[sel];\nendmodule\n", "module top_module (\n input [255:0] in,\n input [7:0] sel,\n output out\n);\n assign out = in[sel];\nendmodule\n", "module top_module (\n\tinput [255:0] in,\n\tinput [7:0] sel,\n\toutput out\n);\n\tassign out = in[sel];\nendmodule\n", "module top_module (\n\tinput [255:0] in,\n\tinput [7:0] sel,\n\toutput out\n);\n\n\tassign out = in[sel];\n\nendmodule\n", "module top_module (\n input [255:0] in,\n input [7:0] sel,\n output out\n);\n assign out = in[sel];\nendmodule\n", "module top_module (\n input [255:0] in,\n input [7:0] sel,\n output out\n);\n assign out = in[sel];\nendmodule\n", "module top_module (\n input [255:0] in,\n input [7:0] sel,\n output out\n);\n assign out = in[sel];\nendmodule\n", "module top_module (\n\tinput [255:0] in,\n\tinput [7:0] sel,\n\toutput out\n);\n\tassign out = in[sel];\nendmodule\n", "module top_module (\n\tinput [255:0] in,\n\tinput [7:0] sel,\n\toutput out\n);\n\tassign out = in[sel];\nendmodule\n"]}
{"task_id": "2014_q4a", "llmgen_RTL": ["module top_module (\n\tinput clk,\n\tinput w,\n\tinput R,\n\tinput E,\n\tinput L,\n\toutput reg Q\n);\n\nalways @(posedge clk) begin\n\tif (L) begin\n\t\tQ <= R;\n\tend else if (E) begin\n\t\tQ <= w;\n\tend\nend\n\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput w,\n\tinput R,\n\tinput E,\n\tinput L,\n\toutput reg Q\n);\n\nalways @(posedge clk) begin\n\tif (L) begin\n\t\tQ <= R; // Load R into Q when L is asserted\n\tend else if (E) begin\n\t\tQ <= w; // Shift w into Q when E is asserted\n\tend\nend\n\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput w,\n\tinput R,\n\tinput E,\n\tinput L,\n\toutput reg Q\n);\n \n\talways @(posedge clk) begin\n\t\tif (L) begin\n\t\t\tQ <= R;\n\t\tend else if (E) begin\n\t\t\tQ <= w;\n\t\tend\n\tend\n\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput w,\n\tinput R,\n\tinput E,\n\tinput L,\n\toutput reg Q\n);\n\n always @(posedge clk) begin\n if (L) begin\n Q <= R;\n end else if (E) begin\n Q <= w;\n end\n end\n\nendmodule\n", "module top_module (\n input clk,\n input w,\n input R,\n input E,\n input L,\n output reg Q\n);\n\n always @(posedge clk) begin\n if (L) begin\n Q <= R; // Load value R into Q when L is asserted\n end else if (E) begin\n Q <= w; // Shift in w when E is asserted\n end // If neither L nor E are asserted, Q retains its value\n end\n\nendmodule\n", "module top_module (\n input clk,\n input w,\n input R,\n input E,\n input L,\n output reg Q\n);\n\n always @(posedge clk) begin\n if (L) begin\n Q <= R; // Load the value of R\n end else if (E) begin\n Q <= w; // Shift operation\n end\n end\nendmodule\n", "module top_module (\n input clk,\n input w,\n input R,\n input E,\n input L,\n output reg Q\n);\n\n wire load_value;\n wire shift_value;\n\n // Multiplexer to choose between load value and shift value\n assign load_value = L ? R : Q; // Load R when L is asserted\n assign shift_value = E ? w : load_value; // Shift in w when E is asserted\n\n always @(posedge clk) begin\n if (L) begin\n Q <= R; // Load value R\n end else if (E) begin\n Q <= w; // Shift in value w\n end\n end\n\nendmodule\n", "module top_module (\n input clk,\n input w,\n input R,\n input E,\n input L,\n output reg Q\n);\n\n always @(posedge clk) begin\n if (L) begin\n Q <= R;\n end else if (E) begin\n Q <= w;\n end\n end\n\nendmodule\n", "module top_module (\n input clk,\n input w,\n input R,\n input E,\n input L,\n output reg Q\n);\n \n wire mux_out;\n \n // 2-to-1 multiplexer for selecting between w and R\n assign mux_out = (L) ? R : w; // Load R when L is high, otherwise take w\n\n always @(posedge clk) begin\n if (E) begin\n Q <= mux_out; // Update Q with mux output on enable\n end\n end\n\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput w,\n\tinput R,\n\tinput E,\n\tinput L,\n\toutput reg Q\n);\n\nalways @(posedge clk) begin\n\tif (L) begin\n\t\tQ <= R; // Load R into Q when L is asserted\n\tend else if (E) begin\n\t\tQ <= w; // Shift in w when E is asserted\n\tend\nend\n\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput w,\n\tinput R,\n\tinput E,\n\tinput L,\n\toutput reg Q\n);\n \n reg next_Q;\n\n always @* begin\n if (L) begin\n next_Q = R; // Load value R when L is asserted\n end else if (E) begin\n next_Q = w; // Shift the input w when E is asserted\n end else begin\n next_Q = Q; // Retain current value\n end\n end\n\n always @(posedge clk) begin\n Q <= next_Q; // Update Q on the rising edge of clk\n end\n\nendmodule\n", "module top_module (\n input clk,\n input w,\n input R,\n input E,\n input L,\n output reg Q\n);\n\n always @(posedge clk)
{"task_id": "ece241_2014_q4", "llmgen_RTL": ["module top_module (\n input clk,\n input x,\n output z\n);\n reg [2:0] dff_out;\n\n wire dff0_d, dff1_d, dff2_d;\n wire dff0_q = dff_out[0];\n wire dff1_q = dff_out[1];\n wire dff2_q = dff_out[2];\n\n // D flip-flop inputs\n assign dff0_d = x ^ dff0_q; // XOR\n assign dff1_d = x & ~dff1_q; // AND\n assign dff2_d = x | ~dff2_q; // OR\n\n // Flip-flops\n always @(posedge clk) begin\n dff_out <= {dff2_d, dff1_d, dff0_d};\n end\n\n // Z output\n assign z = ~(dff0_q ^ dff1_q ^ dff2_q); // XNOR\n\nendmodule\n", "module top_module (\n input clk,\n input x,\n output z\n);\n\n reg q1, q2, q3;\n wire d1, d2, d3;\n wire not_q1, not_q2, not_q3;\n\n assign not_q1 = ~q1;\n assign not_q2 = ~q2;\n assign not_q3 = ~q3;\n\n assign d1 = x ^ q1;\n assign d2 = x & not_q2;\n assign d3 = x | not_q3;\n\n always @(posedge clk) begin\n q1 <= d1;\n q2 <= d2;\n q3 <= d3;\n end\n\n assign z = q1 ~^ q2 ~^ q3;\n\nendmodule\n", "module top_module (\n input clk,\n input x,\n output z\n);\n\n reg dff_a, dff_b, dff_c;\n wire xor_out, and_out, or_out;\n\n always @(posedge clk) begin\n dff_a <= xor_out;\n dff_b <= and_out;\n dff_c <= or_out;\n end\n\n assign xor_out = x ^ dff_a;\n assign and_out = x & ~dff_b;\n assign or_out = x | ~dff_c;\n\n assign z = ~(dff_a ^ dff_b ^ dff_c);\n\nendmodule\n", "module top_module (\n input clk,\n input x,\n output z\n);\n reg dff0, dff1, dff2;\n wire d0, d1, d2;\n\n assign d0 = x ^ dff0; // XOR gate\n assign d1 = x & ~dff1; // AND gate\n assign d2 = x | ~dff2; // OR gate\n\n always @(posedge clk) begin\n dff0 <= d0;\n dff1 <= d1;\n dff2 <= d2;\n end\n\n assign z = dff0 ~^ dff1 ~^ dff2; // XNOR of the flip-flop outputs\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput x,\n\toutput z\n);\n\treg dff1, dff2, dff3;\n\twire d1, d2, d3;\n\twire not_dff1, not_dff2, not_dff3;\n\n\tassign not_dff1 = ~dff1;\n\tassign not_dff2 = ~dff2;\n\tassign not_dff3 = ~dff3;\n\n\tassign d1 = x ^ dff1;\n\tassign d2 = x & not_dff2;\n\tassign d3 = x | not_dff3;\n\n\talways @(posedge clk) begin\n\t\tdff1 <= d1;\n\t\tdff2 <= d2;\n\t\tdff3 <= d3;\n\tend\n\n\tassign z = dff1 ~^ dff2 ~^ dff3;\n\nendmodule\n", "module top_module (\n input clk,\n input x,\n output z\n);\n reg q0, q1, q2;\n wire d0, d1, d2;\n\n // D flip-flop inputs\n assign d0 = x ^ q0;\n assign d1 = x & ~q1;\n assign d2 = x | ~q2;\n\n // D flip-flops\n always @(posedge clk) begin\n q0 <= d0;\n q1 <= d1;\n q2 <= d2;\n end\n\n // XNOR output\n assign z = ~(q0 ^ q1 ^ q2);\n\nendmodule\n", "module top_module (\n input clk,\n input x,\n output z\n);\n reg dff1, dff2, dff3;\n wire xnor_input1, xnor_input2, xnor_input3;\n wire dff1_complement, dff2_complement, dff3_complement;\n\n assign dff1_complement = ~dff1;\n assign dff2_complement = ~dff2;\n assign dff3_complement = ~dff3;\n\n assign xnor_input1 = x ^ dff1;\n assign xnor_input2 = x & dff2_complement;\n assign xnor_input3 = x | dff3_complement;\n\n always @(posedge clk) begin\n dff1 <= xnor_input1;\n dff2 <= xnor_input2;\n dff3 <= xnor_input3;\n end\n\n assign z = dff1 ^ dff2 ^ dff3;\n\nendmodule\n", "module top_module (\n input clk,\n input x,\n output z\n);\n\n reg dff0, dff1, dff2;\n wire d0, d1, d2;\n wire w0, w1, w2;\n\n always @(posedge clk) begin\n dff0 <= d0;\n dff1 <= d1;\n dff2 <= d2;\n end\n\n assign d0 = x ^ dff0;\n assign d1 = x & ~dff1;\n assign d2 = x | ~dff2;\n\n assign w0 = dff0;\n assign w1 = ~dff1;\n assign w2 = ~dff2;\n\n assign z = w0 ~^ w1 ~^ w2;\n\nendmodule\n", "module top_module (\n input clk,\n input x,\n output z\n);\n reg [2:0] dff; // D fli
{"task_id": "circuit4", "llmgen_RTL": ["module top_module (\n\tinput a, \n\tinput b, \n\tinput c, \n\tinput d,\n\toutput q\n);\n\tassign q = (a & ~b & ~c & ~d) | (a & ~b & c & d) | (a & b & ~c & ~d) | (a & b & c & d) | (b & ~c & ~d) | (b & c & d) | (c & ~d);\nendmodule\n", "module top_module (\n input a, \n input b, \n input c, \n input d,\n output q\n);\n assign q = (~a & ~b & d) | (~a & b & c) | (a & ~b & c & ~d) | (a & b & ~c & ~d) | (a & b & c & d);\nendmodule\n", "module top_module (\n input a, \n input b, \n input c, \n input d,\n output q\n);\n assign q = (b & (d | c)) | (a & ((c & ~d) | (b & d)));\nendmodule\n", "module top_module (\n input a, \n input b, \n input c, \n input d,\n output q\n);\n assign q = (b & (c ^ d)) | (a & b) | (a & c) | (a & d);\nendmodule\n", "module top_module (\n\tinput a, \n\tinput b, \n\tinput c, \n\tinput d,\n\toutput q\n);\n\tassign q = (a & b & ~c & ~d) | (a & ~b & c & d) | (a & ~b & c & ~d) | \n\t (a & ~b & ~c & d) | (~a & b & ~c & d) | (~a & b & c & ~d) | \n\t (~a & b & c & d) | (~a & ~b & c & d);\nendmodule\n", "module top_module (\n\tinput a, \n\tinput b, \n\tinput c, \n\tinput d,\n\toutput q\n);\n\tassign q = (a & b & c) | (b & d) | (a & c & ~d) | (a & ~b & d);\nendmodule\n", "module top_module (\n input a, \n input b, \n input c, \n input d,\n output q\n);\n assign q = (a == 1'b0 && b == 1'b0 && d == 1'b1) || \n (a == 1'b0 && b == 1'b1) || \n (a == 1'b1 && b == 1'b0 && c == 1'b1) || \n (a == 1'b1 && b == 1'b1);\nendmodule\n", "module top_module (\n\tinput a, \n\tinput b, \n\tinput c, \n\tinput d,\n\toutput q\n);\n\tassign q = (d & (b | c)) | ((~a & b & ~c) | (a & b & c));\nendmodule\n", "module top_module (\n input a, \n input b, \n input c, \n input d,\n output q\n);\n assign q = (b & c) | (a & (c ^ d));\nendmodule\n", "module top_module (\n\tinput a, \n\tinput b, \n\tinput c, \n\tinput d,\n\toutput q\n);\n\nassign q = (a & (b | c)) | (b & d) | (c & ~d);\n\nendmodule\n", "module top_module (\n input a, \n input b, \n input c, \n input d,\n output q\n);\n assign q = (~a & ~b & d) | (~a & b & c) | (a & ~b & c) | (a & b & d);\nendmodule\n", "module top_module (\n\tinput a, \n\tinput b, \n\tinput c, \n\tinput d,\n\toutput q\n);\n\nassign q = (b && c && d) || (a && !b && c) || (a && !b && !d) || (a && b && d);\n\nendmodule\n", "module top_module (\n\tinput a, \n\tinput b, \n\tinput c, \n\tinput d,\n\toutput q\n);\n\tassign q = (a & ~b & c) | (a & ~b & d) | (a & b & ~c & ~d) | (a & b & ~c & d) | (b & c & d);\nendmodule\n", "module top_module (\n input a, \n input b, \n input c, \n input d,\n output q\n);\n assign q = (a && b && d) || (b && c) || (a && c && !d) || (b && !a && c && d);\nendmodule\n", "module top_module (\n input a, \n input b, \n input c, \n input d,\n output q\n);\n assign q = (d & (b | c)) | (a & (b | c | d));\nendmodule\n", "module top_module (\n input a, \n input b, \n input c, \n input d,\n output q\n);\n\nassign q = (b & d) | (a & c) | (b & c & d);\n\nendmodule\n", "module top_module (\n\tinput a, \n\tinput b, \n\tinput c, \n\tinput d,\n\toutput q\n);\n\tassign q = (a & b & c & d) | (b & c & d) | (a & c & d) | (a & b & d) | (a & b & c);\nendmodule\n", "module top_module (\n input a, \n input b, \n input c, \n input d,\n output q\n);\n\nassign q = (b & ~c) | (a & c) | (a & b) | (c & d);\n\nendmodule\n", "module top_module (\n\tinput a, \n\tinput b, \n\tinput c, \n\tinput d,\n\toutput q\n);\n\tassign q = (a & ~b & ~c & ~d) | (a & ~b & c & d) | (a & b & ~c & ~d) | (a & b & ~c & d) | \n (b & ~c & d) | (b & c & ~d) | (b & c & d) | (c & d);\nendmodule\n", "module top_module (\n input a, \n input b, \n input c, \n input d,\n output q\n);\n assign q = (~a & ~b & c & d) | (~a & b & c) | (a & ~b & ~c & ~d) | (a & ~b & c & d) | (a & b & c & ~d) | (a & b & c & d);\nendmodule\n"]}
{"task_id": "rule110", "llmgen_RTL": ["module top_module(\n\tinput clk,\n\tinput load,\n\tinput [511:0] data,\n\toutput reg [511:0] q);\n\n\talways @(posedge clk) begin\n\t\tif (load) begin\n\t\t\tq <= data;\n\t\tend else begin\n\t\t\treg [511:0] next_q;\n\t\t\tinteger i;\n\t\t\tfor (i = 0; i < 512; i = i + 1) begin\n\t\t\t\tnext_q[i] = (i == 0 ? 0 : q[i-1]) & (q[i] | q[i+1]) | (q[i] & (q[i+1] | (i == 511 ? 0 : q[i+2]))) );\n\t\t\tend\n\t\t\tq <= next_q;\n\t\tend\n\tend\nendmodule\n", "module top_module(\n input clk,\n input load,\n input [511:0] data,\n output reg [511:0] q\n);\n \n reg [511:0] next_q;\n\n always @(posedge clk) begin\n if (load) begin\n q <= data;\n end else begin\n q <= next_q;\n end\n end\n\n always @(*) begin\n next_q[0] = (q[0] & q[1]) | (q[0] & ~q[2]) | (~q[1] & q[2]);\n next_q[511] = (q[510] & q[511]) | (q[510] & ~0) | (~q[511] & 0); // Boundary condition\n for (int i = 1; i < 511; i = i + 1) begin\n next_q[i] = (q[i-1] & q[i]) | (q[i-1] & ~q[i+1]) | (~q[i] & q[i+1]);\n end\n end\n\nendmodule\n", "module top_module(\n input clk,\n input load,\n input [511:0] data,\n output reg [511:0] q\n);\n\n reg [511:0] next_q;\n\n always @(posedge clk) begin\n if (load) begin\n q <= data;\n end else begin\n q <= next_q;\n end\n end\n\n always @* begin\n next_q[0] = (q[0] & q[1]) | (q[0] & ~q[2]) | (~q[1] & q[2]);\n next_q[511] = (q[510] & q[511]) | (q[510] & 0) | (~q[511] & 0);\n for (int i = 1; i < 511; i = i + 1) begin\n next_q[i] = (q[i-1] & q[i]) | (q[i-1] & ~q[i+1]) | (~q[i] & q[i+1]);\n end\n end\n\nendmodule\n", "module top_module(\n input clk,\n input load,\n input [511:0] data,\n output reg [511:0] q\n);\n reg [511:0] next_q;\n\n always @* begin\n next_q[0] = (q[0] & q[1]) | (q[1] & 0) | (q[1] & q[2]);\n next_q[511] = (q[510] & q[511]) | (q[511] & 0) | (q[510] & 0);\n for (integer i = 1; i < 511; i = i + 1) begin\n next_q[i] = (q[i-1] & q[i]) | (q[i] & q[i+1]) | (q[i-1] & 0) | (q[i] & 0);\n end\n end\n\n always @(posedge clk) begin\n if (load) begin\n q <= data;\n end else begin\n q <= next_q;\n end\n end\nendmodule\n", "module top_module(\n input clk,\n input load,\n input [511:0] data,\n output reg [511:0] q\n);\n\n reg [511:0] next_q;\n\n always @(posedge clk) begin\n if (load) begin\n q <= data;\n end else begin\n q <= next_q;\n end\n end\n\n always @* begin\n next_q[0] = (q[0] & q[1]) | (q[0] & ~q[2]) | (~q[1] & q[2]);\n next_q[511] = (q[510] & q[511]) | (q[510] & ~0) | (~q[511] & 0);\n \n for (int i = 1; i < 511; i = i + 1) begin\n next_q[i] = (q[i-1] & q[i]) | (q[i-1] & ~q[i+1]) | (~q[i] & q[i+1]);\n end\n end\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput load,\n\tinput [511:0] data,\n\toutput reg [511:0] q);\n\n\talways @(posedge clk) begin\n\t\tif (load) begin\n\t\t\tq <= data;\n\t\tend else begin\n\t\t\treg [511:0] next_q;\n\t\t\tinteger i;\n\t\t\tfor (i = 0; i < 512; i = i + 1) begin\n\t\t\t\tcase ({(i == 0) ? 0 : q[i-1], q[i], (i == 511) ? 0 : q[i+1]})\n\t\t\t\t\t3'b111: next_q[i] = 0;\n\t\t\t\t\t3'b110: next_q[i] = 1;\n\t\t\t\t\t3'b101: next_q[i] = 1;\n\t\t\t\t\t3'b100: next_q[i] = 0;\n\t\t\t\t\t3'b011: next_q[i] = 1;\n\t\t\t\t\t3'b010: next_q[i] = 1;\n\t\t\t\t\t3'b001: next_q[i] = 1;\n\t\t\t\t\t3'b000: next_q[i] = 0;\n\t\t\t\tendcase\n\t\t\tend\n\t\t\tq <= next_q;\n\t\tend\n\tend\nendmodule\n", "module top_module(\n input clk,\n input load,\n input [511:0] data,\n output reg [511:0] q\n);\n\n reg [511:0] next_q;\n\n always @(posedge clk) begin\n if (load) begin\n q <= data;\n end else begin\n q <= next_q;\n end\n end\n\n always @* begin\n next_q = 0; // Initia
{"task_id": "fsm3s", "llmgen_RTL": ["module top_module (\n input clk,\n input in,\n input reset,\n output reg out\n);\n\n // State encoding\n typedef enum logic [1:0] {\n A = 2'b00,\n B = 2'b01,\n C = 2'b10,\n D = 2'b11\n } state_t;\n\n state_t current_state, next_state;\n\n // Output logic\n always_ff @(current_state) begin\n case (current_state)\n A: out = 0;\n B: out = 0;\n C: out = 0;\n D: out = 1;\n default: out = 0;\n endcase\n end\n\n // State transition logic\n always_ff @(posedge clk or posedge reset) begin\n if (reset) begin\n current_state <= A;\n end else begin\n current_state <= next_state;\n end\n end\n\n // Next state logic\n always_ff @(current_state, in) begin\n case (current_state)\n A: next_state = (in == 0) ? A : B;\n B: next_state = (in == 0) ? C : B;\n C: next_state = (in == 0) ? A : D;\n D: next_state = (in == 0) ? C : B;\n default: next_state = A;\n endcase\n end\n\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput in,\n\tinput reset,\n\toutput reg out\n);\n\ntypedef enum reg [1:0] {A, B, C, D} state_t;\nstate_t state, next_state;\n\nalways @(posedge clk or posedge reset) begin\n\tif (reset) begin\n\t\tstate <= A;\n\tend else begin\n\t\tstate <= next_state;\n\tend\nend\n\nalways @(*) begin\n\tcase (state)\n\t\tA: begin\n\t\t\tnext_state = (in == 0) ? A : B;\n\t\t\tout = 0;\n\t\tend\n\t\tB: begin\n\t\t\tnext_state = (in == 0) ? C : B;\n\t\t\tout = 0;\n\t\tend\n\t\tC: begin\n\t\t\tnext_state = (in == 0) ? A : D;\n\t\t\tout = 0;\n\t\tend\n\t\tD: begin\n\t\t\tnext_state = (in == 0) ? C : B;\n\t\t\tout = 1;\n\t\tend\n\t\tdefault: begin\n\t\t\tnext_state = A;\n\t\t\tout = 0;\n\t\tend\n\tendcase\nend\n\nendmodule\n", "module top_module (\n input clk,\n input in,\n input reset,\n output reg out\n);\n reg [1:0] state, next_state;\n\n parameter A = 2'b00, B = 2'b01, C = 2'b10, D = 2'b11;\n\n always @(posedge clk or posedge reset) begin\n if (reset) begin\n state <= A;\n end else begin\n state <= next_state;\n end\n end\n\n always @(*) begin\n case (state)\n A: begin\n next_state = (in) ? B : A;\n out = 0;\n end\n B: begin\n next_state = (in) ? B : C;\n out = 0;\n end\n C: begin\n next_state = (in) ? D : A;\n out = 0;\n end\n D: begin\n next_state = (in) ? B : C;\n out = 1;\n end\n endcase\n end\nendmodule\n", "module top_module (\n input clk,\n input in,\n input reset,\n output reg out\n);\n\n typedef enum logic [1:0] {\n A = 2'b00,\n B = 2'b01,\n C = 2'b10,\n D = 2'b11\n } state_t;\n\n state_t current_state, next_state;\n\n always_ff @(posedge clk or posedge reset) begin\n if (reset) begin\n current_state <= A;\n end else begin\n current_state <= next_state;\n end\n end\n\n always_ff @(current_state, in) begin\n case (current_state)\n A: begin\n if (in)\n next_state = B;\n else\n next_state = A;\n out = 0;\n end\n B: begin\n if (in)\n next_state = B;\n else\n next_state = C;\n out = 0;\n end\n C: begin\n if (in)\n next_state = D;\n else\n next_state = A;\n out = 0;\n end\n D: begin\n if (in)\n next_state = B;\n else\n next_state = C;\n out = 1;\n
{"task_id": "circuit5", "llmgen_RTL": ["module top_module (\n\tinput [3:0] a, \n\tinput [3:0] b, \n\tinput [3:0] c, \n\tinput [3:0] d,\n\tinput [3:0] e,\n\toutput reg [3:0] q\n);\n\talways @(*) begin\n\t\tcase (c)\n\t\t\t4'b0000: q = b;\n\t\t\t4'b0001: q = e;\n\t\t\t4'b0010: q = a;\n\t\t\t4'b0011: q = d;\n\t\t\t4'b0100: q = f;\n\t\t\t4'b0101: q = f;\n\t\t\t4'b0110: q = f;\n\t\t\t4'b0111: q = f;\n\t\t\t4'b1000: q = f;\n\t\t\t4'b1001: q = f;\n\t\t\t4'b1010: q = f;\n\t\t\t4'b1011: q = f;\n\t\t\t4'b1100: q = f;\n\t\t\t4'b1101: q = f;\n\t\t\t4'b1110: q = f;\n\t\t\tdefault: q = 4'bxxxx;\n\t\tendcase\n\tend\nendmodule\n", "module top_module (\n\tinput [3:0] a, \n\tinput [3:0] b, \n\tinput [3:0] c, \n\tinput [3:0] d,\n\tinput [3:0] e,\n\toutput reg [3:0] q\n);\n\talways @(*) begin\n\t\tcase (c)\n\t\t\t4'b0000: q = b; // c = 0\n\t\t\t4'b0001: q = e; // c = 1\n\t\t\t4'b0010: q = a; // c = 2\n\t\t\t4'b0011: q = d; // c = 3\n\t\t\tdefault: begin\n\t\t\t\tif (c >= 4'b0100 && c <= 4'b1001) \n\t\t\t\t\tq = 4'b1111; // For c = 4 to 9\n\t\t\t\telse\n\t\t\t\t\tq = f; // For c = A to F (not specified, assuming a fixed value)\n\t\t\tend\n\t\tendcase\n\tend\nendmodule\n", "module top_module (\n\tinput [3:0] a, \n\tinput [3:0] b, \n\tinput [3:0] c, \n\tinput [3:0] d,\n\tinput [3:0] e,\n\toutput reg [3:0] q\n);\n\talways @(*) begin\n\t\tcase ({c, d, e})\n\t\t\t{4'b0000, 4'b0000, 4'b0000}: q = 4'b0000; // initialization\n\t\t\t{4'b0001, 4'b0000, 4'b0000}: q = b; // at 15ns\n\t\t\t{4'b0001, 4'b0000, 4'b0001}: q = e; // at 20ns\n\t\t\t{4'b0001, 4'b0000, 4'b0010}: q = a; // at 25ns\n\t\t\t{4'b0001, 4'b0000, 4'b0011}: q = d; // at 30ns\n\t\t\t{4'b0001, 4'b0000, 4'b0100}: q = 4'b1111; // at 35ns\n\t\t\t{4'b0001, 4'b0000, 4'b0101}: q = 4'b1111; // at 40ns\n\t\t\t{4'b0001, 4'b0000, 4'b0110}: q = 4'b1111; // at 45ns\n\t\t\t{4'b0001, 4'b0000, 4'b0111}: q = 4'b1111; // at 50ns\n\t\t\t{4'b0001, 4'b0000, 4'b1000}: q = 4'b1111; // at 55ns\n\t\t\t{4'b0001, 4'b0000, 4'b1001}: q = 4'b1111; // at 60ns\n\t\t\t{4'b0001, 4'b0001, 4'b0000}: q = 4'b1111; // at 65ns\n\t\t\t{4'b0001, 4'b0001, 4'b0001}: q = 4'b1111; // at 70ns\n\t\t\t{4'b0001, 4'b0001, 4'b0010}: q = 4'b1111; // at 75ns\n\t\t\t{4'b0001, 4'b0001, 4'b0011}: q = 4'b1111; // at 80ns\n\t\t\t{4'b0001, 4'b0001, 4'b0100}: q = 4'b1111; // at 85ns\n\t\t\t{4'b0001, 4'b0001, 4'b0101}: q = 4'b1111; // at 90ns\n\t\t\tdefault: q = 4'b0000;\n\t\tendcase\n\tend\nendmodule\n", "module top_module (\n\tinput [3:0] a, \n\tinput [3:0] b, \n\tinput [3:0] c, \n\tinput [3:0] d,\n\tinput [3:0] e,\n\toutput reg [3:0] q\n);\n\nalways @(*) begin\n\tcase (c)\n\t\t4'd0: q = b;\n\t\t4'd1: q = e;\n\t\t4'd2: q = a;\n\t\t4'd3: q = d;\n\t\t4'd4: q = 4'd15; // f\n\t\t4'd5: q = 4'd15; // f\n\t\t4'd6: q = 4'd15; // f\n\t\t4'd7: q = 4'd15; // f\n\t\t4'd8: q = 4'd15; // f\n\t\t4'd9: q = 4'd15; // f\n\t\t4'd10: q = 4'd15; // f\n\t\t4'd11: q = 4'd15; // f\n\t\t4'd12: q = 4'd15; // f\n\t\t4'd13: q = 4'd15; // f\n\t\t4'd14: q = 4'd15; // f\n\t\t4'd15: q = 4'd15; // f\n\t\tdefault: q = 4'dx; // unspecified behavior\n\tendcase\nend\n\nendmodule\n", "module top_module (\n\tinput [3:0] a, \n\tinput [3:0] b, \n\tinput [3:0] c, \n\tinput [3:0] d,\n\tinput [3:0] e,\n\toutput reg [3:0] q\n);\n\talways @(*) begin\n\t\tcase (c)\n\t\t\t4'd0: q = b;\n\t\t\t4'd1: q = e;\n\t\t\t4'd2: q = a;\n\t\t\t4'd3: q = d;\n\t\t\t4'd4: q = 4'hf; // Assuming 'f' relates to the highest input of 'e'\n\t\t\t4'd5: q = 4'hf;\n\t\t\t4'd6: q = 4'hf;\n\t\t\t4'd7: q = 4'hf;\n\t\t\t4'd8: q = 4'hf;\n\t\t\t4'd9: q = 4'hf;\n\t\t\t4'd10: q = 4'hf; // a \n\t\t\t4'd11: q = 4'hf; // b\n\t\t\t4'd12: q = 4'hf; // c\n\t\t\t4'd13: q = 4'hf; // d\n\t\t\t4'd14: q = 4'hf; // e\n\t\t\t4'd15: q = 4'hf; // f\n\t\t\tdefault: q = 4'hx; // Undefined state\n\t\tendcase\n\tend\nendmodule\n", "module top_module (\n\tinput [3:0] a, \n\tinput [3:0] b, \n\tinput [3:0] c, \n\tinput [3:0] d,\n\tinput [3:0] e,\n\toutput reg [3:0] q\n);\n\nalways @(*) begin\n\tcase (c)\n\t\t4'd0: q = b; // when c is 0\n\t\t4'd1: q = e; // when c is 1\n\t\t4'd2: q = a;
{"task_id": "bugs_mux2", "llmgen_RTL": ["module top_module (\n\tinput sel,\n\tinput [7:0] a,\n\tinput [7:0] b,\n\toutput reg [7:0] out\n);\n\n\talways @(*) begin\n\t\tif (sel) begin\n\t\t\tout = b;\n\t\tend else begin\n\t\t\tout = a;\n\t\tend\n\tend\n\nendmodule\n", "module top_module (\n\tinput sel,\n\tinput [7:0] a,\n\tinput [7:0] b,\n\toutput reg [7:0] out\n);\n\n\talways @* begin\n\t\tif (sel)\n\t\t\tout = b;\n\t\telse\n\t\t\tout = a;\n\tend\n\nendmodule\n", "module top_module (\n input sel,\n input [7:0] a,\n input [7:0] b,\n output reg [7:0] out\n);\n\n always @(*) begin\n out = (sel) ? b : a;\n end\n\nendmodule\n", "module top_module (\n\tinput sel,\n\tinput [7:0] a,\n\tinput [7:0] b,\n\toutput reg [7:0] out\n);\n\n\talways @(*) begin\n\t\tif (sel) \n\t\t\tout = b;\n\t\telse \n\t\t\tout = a;\n\tend\n\nendmodule\n", "module top_module (\n input sel,\n input [7:0] a,\n input [7:0] b,\n output reg [7:0] out\n);\n\n always @(*) begin\n out = (sel) ? b : a;\n end\n\nendmodule\n", "module top_module (\n\tinput sel,\n\tinput [7:0] a,\n\tinput [7:0] b,\n\toutput reg [7:0] out\n);\n\nalways @(*) begin\n\tif (sel) \n\t\tout = b;\n\telse \n\t\tout = a;\nend\n\nendmodule\n", "module top_module (\n input sel,\n input [7:0] a,\n input [7:0] b,\n output reg [7:0] out\n);\n\n always @(*) begin\n if (sel) \n out = b;\n else \n out = a;\n end\n\nendmodule\n", "module top_module (\n\tinput sel,\n\tinput [7:0] a,\n\tinput [7:0] b,\n\toutput reg [7:0] out\n);\n\n\talways @(*) begin\n\t\tif (sel) \n\t\t\tout = b;\n\t\telse \n\t\t\tout = a;\n\tend\n\nendmodule\n", "module top_module (\n\tinput sel,\n\tinput [7:0] a,\n\tinput [7:0] b,\n\toutput reg [7:0] out\n);\n\n\talways @(*) begin\n\t\tif (sel) \n\t\t\tout = b;\n\t\telse \n\t\t\tout = a;\n\tend\n\nendmodule\n", "module top_module (\n\tinput sel,\n\tinput [7:0] a,\n\tinput [7:0] b,\n\toutput reg [7:0] out\n);\n\n\talways @(*) begin\n\t\tif (sel)\n\t\t\tout = b;\n\t\telse\n\t\t\tout = a;\n\tend\n\nendmodule\n", "module top_module (\n\tinput sel,\n\tinput [7:0] a,\n\tinput [7:0] b,\n\toutput reg [7:0] out\n);\n\n\talways @(*) begin\n\t\tif (sel) \n\t\t\tout = b;\n\t\telse \n\t\t\tout = a;\n\tend\n\nendmodule\n", "module top_module (\n\tinput sel,\n\tinput [7:0] a,\n\tinput [7:0] b,\n\toutput reg [7:0] out\n);\n\n\talways @(*) begin\n\t\tif (sel) \n\t\t\tout = b;\n\t\telse \n\t\t\tout = a;\n\tend\n\nendmodule\n", "module top_module (\n input sel,\n input [7:0] a,\n input [7:0] b,\n output reg [7:0] out\n);\n\n always @* begin\n if (sel) \n out = b;\n else \n out = a;\n end\n\nendmodule\n", "module top_module (\n\tinput sel,\n\tinput [7:0] a,\n\tinput [7:0] b,\n\toutput reg [7:0] out\n);\n\n\talways @(*) begin\n\t\tif (sel) \n\t\t\tout = b;\n\t\telse \n\t\t\tout = a;\n\tend\n\nendmodule\n", "module top_module (\n input sel,\n input [7:0] a,\n input [7:0] b,\n output reg [7:0] out\n);\n \n always @(*) begin\n out = (sel) ? b : a;\n end\n\nendmodule\n", "module top_module (\n\tinput sel,\n\tinput [7:0] a,\n\tinput [7:0] b,\n\toutput reg [7:0] out\n);\n\n\talways @(*) begin\n\t\tif (sel) \n\t\t\tout = b;\n\t\telse \n\t\t\tout = a;\n\tend\n\nendmodule\n", "module top_module (\n\tinput sel,\n\tinput [7:0] a,\n\tinput [7:0] b,\n\toutput reg [7:0] out\n);\n\n\talways @(*) begin\n\t\tif (sel) \n\t\t\tout = b;\n\t\telse \n\t\t\tout = a;\n\tend\n\nendmodule\n", "module top_module (\n\tinput sel,\n\tinput [7:0] a,\n\tinput [7:0] b,\n\toutput reg [7:0] out\n);\n\n\talways @(*) begin\n\t\tif (sel)\n\t\t\tout = b;\n\t\telse\n\t\t\tout = a;\n\tend\n\nendmodule\n", "module top_module (\n input sel,\n input [7:0] a,\n input [7:0] b,\n output reg [7:0] out\n);\n\n always @(*) begin\n if (sel) \n out = b;\n else \n out = a;\n end\n\nendmodule\n", "module top_module (\n input sel,\n input [7:0] a,\n input [7:0] b,\n output reg [7:0] out\n);\n\n always @(*)
{"task_id": "mt2015_muxdff", "llmgen_RTL": ["module top_module(\n input clk,\n input L,\n input q_in,\n input r_in,\n output reg Q\n);\n \n reg [2:0] r;\n wire [2:0] q;\n\n // Flip-Flop\n always @(posedge clk) begin\n if (L) begin\n Q <= r_in;\n end else begin\n Q <= {Q[1] ^ Q[2], Q[0], Q[2]};\n end\n end\n\n // Instantiation of submodules\n full_module u1(.r(r), .L(L), .clk(clk), .q(q));\n full_module u2(.r(r), .L(L), .clk(clk), .q(q));\n full_module u3(.r(r), .L(L), .clk(clk), .q(q));\n\nendmodule\n", "module top_module(\n input clk,\n input L,\n input q_in,\n input r_in,\n output reg Q\n);\n reg [2:0] q;\n\n always @(posedge clk) begin\n if (L) begin\n q <= {q_in, r_in, q[2]};\n end else begin\n q <= {q[1] ^ q[2], q[0], q[2]};\n end\n end\n\n assign Q = q[0];\nendmodule\n", "module top_module(\n input clk,\n input L,\n input q_in,\n input r_in,\n output reg Q\n);\n reg [2:0] q;\n wire [2:0] r = {r_in, q_in, q[2]};\n wire mux_out;\n\n // 2-to-1 Multiplexer\n assign mux_out = L ? r : {q[1] ^ q[2], q[0], q[2]};\n\n // Flip-Flop\n always @(posedge clk) begin\n Q <= mux_out;\n q <= mux_out;\n end\nendmodule\n", "module top_module(\n input clk,\n input L,\n input q_in,\n input r_in,\n output reg Q\n);\n wire [2:0] r;\n wire [2:0] q;\n\n assign r = {r_in, q_in, r_in};\n\n always @(posedge clk) begin\n if (L) begin\n Q <= r[0]; // Example connection\n end else begin\n Q <= q[0] ^ q[1]; // Example flip flop logic\n end\n end\n\n // Instantiate the full_module three times\n full_module u1 (\n .r(r[2:0]),\n .L(L),\n .clk(clk),\n .q(q)\n );\n \n full_module u2 (\n .r(r[2:0]),\n .L(L),\n .clk(clk),\n .q(q)\n );\n\n full_module u3 (\n .r(r[2:0]),\n .L(L),\n .clk(clk),\n .q(q)\n );\n\nendmodule\n", "module top_module(\n input clk,\n input L,\n input q_in,\n input r_in,\n output reg Q\n);\n reg [2:0] q;\n wire [2:0] r;\n\n assign r = {r_in, 1'b0, 1'b0}; // Extend r_in to 3 bits\n\n always @(posedge clk) begin\n if (L) begin\n q <= r;\n end else begin\n q <= {q[1] ^ q[2], q[0], q[2]};\n end\n end\n\n assign Q = q[0]; // Output the least significant bit of q as Q\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput L,\n\tinput q_in,\n\tinput r_in,\n\toutput reg Q);\n\nwire [2:0] r;\nwire [2:0] q;\n\nassign r = {r_in, q_in, q_in}; // Preparing inputs for the full_module\n\n// Instantiation of full_module three times\nfull_module u1 (\n .r(r),\n .L(L),\n .clk(clk),\n .q(q)\n);\n\nalways @(posedge clk) begin\n Q <= q[0]; // Taking output from the full_module\nend\n\nendmodule\n", "module top_module(\n input clk,\n input L,\n input q_in,\n input r_in,\n output reg Q\n);\n \n reg [2:0] q;\n\n always @(posedge clk) begin\n if (L) begin\n q <= {q_in, r_in, q[2]};\n end else begin\n q <= {q[1] ^ q[2], q[0], q[2]};\n end\n end\n\n assign Q = q[0]; // Output the first bit of q\n\nendmodule\n", "module top_module(\n input clk,\n input L,\n input q_in,\n input r_in,\n output reg Q\n);\n reg [2:0] r;\n wire [2:0] q;\n\n always @(posedge clk) begin\n if (L) begin\n r <= {r_in, r[1:0]};\n end else begin\n r <= {q[1] ^ q[2], q[0], q[2]};\n end\n end\n\n generate\n genvar i;\n for (i = 0; i < 3; i = i + 1) begin: ff\n reg Q_temp;\n always @(posedge clk) begin\n if (L) begin\n Q_temp <= r[i];\n end else begin\n Q_temp <= q[i];\n end\n end\n assign q[i] = Q_temp;\n end\n endgenerate\
{"task_id": "edgecapture", "llmgen_RTL": ["module top_module(\n input clk,\n input reset,\n input [31:0] in,\n output reg [31:0] out\n);\n always @(posedge clk) begin\n if (reset) begin\n out <= 32'b0;\n end else begin\n out <= out | (~in & (out | 32'b0));\n end\n end\nendmodule\n", "module top_module(\n input clk,\n input reset,\n input [31:0] in,\n output reg [31:0] out\n);\n reg [31:0] prev_in;\n\n always @(posedge clk) begin\n if (reset) begin\n out <= 32'b0;\n end else begin\n prev_in <= in;\n out <= out | (~in & prev_in);\n end\n end\nendmodule\n", "module top_module(\n input clk,\n input reset,\n input [31:0] in,\n output reg [31:0] out\n);\n always @(posedge clk) begin\n if (reset) begin\n out <= 32'b0;\n end else begin\n out <= out | (~in & {32{1'b1}} & {in[31:1], 1'b0}); // Capture logic\n end\n end\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput reset,\n\tinput [31:0] in,\n\toutput reg [31:0] out);\n\n\talways @(posedge clk) begin\n\t\tif (reset) begin\n\t\t\tout <= 32'b0;\n\t\tend else begin\n\t\t\tout <= out | (~in & (out >> 1)) | (~in & (out >> 0));\n\t\tend\n\tend\n\nendmodule\n", "module top_module(\n input clk,\n input reset,\n input [31:0] in,\n output reg [31:0] out\n);\n reg [31:0] prev_in;\n\n always @(posedge clk) begin\n if (reset) begin\n out <= 32'b0;\n end else begin\n out <= out | (prev_in & ~in); // Capture the falling edge\n end\n prev_in <= in; // Store previous input state\n end\nendmodule\n", "module top_module(\n input clk,\n input reset,\n input [31:0] in,\n output reg [31:0] out);\n\n always @(posedge clk) begin\n if (reset) begin\n out <= 32'b0;\n end else begin\n out <= (in == 32'b0) ? out : (in & ~out) | out; // Capture falling edge \n end\n end\nendmodule\n", "module top_module(\n input clk,\n input reset,\n input [31:0] in,\n output reg [31:0] out\n);\n\nalways @(posedge clk) begin\n if (reset) begin\n out <= 32'b0;\n end else begin\n out <= (out | ({32{((in ^ {32{1'b1}}) & in)}} & ~in));\n end\nend\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput reset,\n\tinput [31:0] in,\n\toutput reg [31:0] out);\n\n\talways @(posedge clk) begin\n\t\tif (reset) begin\n\t\t\tout <= 32'b0;\n\t\tend else begin\n\t\t\tout <= out | (~in & {32{1'b1}}) & (out | (in & {32{1'b0}}));\n\t\tend\n\tend\n\nendmodule\n", "module top_module(\n input clk,\n input reset,\n input [31:0] in,\n output reg [31:0] out\n);\n\n always @(posedge clk) begin\n if (reset) begin\n out <= 32'b0;\n end else begin\n out <= out | ((in == 0) & (out == 1)); // Capture when input goes from 1 to 0\n end\n end\n\nendmodule\n", "module top_module(\n input clk,\n input reset,\n input [31:0] in,\n output reg [31:0] out\n);\n always @(posedge clk) begin\n if (reset) begin\n out <= 32'b0;\n end else begin\n out <= out | ((in | (out & ~in)) >> 1) & ~in;\n end\n end\nendmodule\n", "module top_module(\n input clk,\n input reset,\n input [31:0] in,\n output reg [31:0] out\n);\n\n always @(posedge clk) begin\n if (reset) begin\n out <= 32'b0;\n end else begin\n out <= out | (~in & (out | in)); // Capture the transition from 1 to 0\n end\n end\n\nendmodule\n", "module top_module(\n input clk,\n input reset,\n input [31:0] in,\n output reg [31:0] out\n);\n\n always @(posedge clk) begin\n if (reset) begin\n out <= 32'b0;\n end else begin\n out <= (in == 32'b0) ? out : (in & ~out);\n end\n end\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput reset,\n\tinput [31:0] in,\n\toutput reg [31:0] out\n);\n\nreg [31:0] last_in
{"task_id": "dff8", "llmgen_RTL": ["module top_module(\n input clk,\n input [7:0] d,\n output reg [7:0] q\n);\n always @(posedge clk) begin\n q <= d;\n end\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput [7:0] d,\n\toutput reg [7:0] q);\n\n\talways @(posedge clk) begin\n\t\tq <= d;\n\tend\n\nendmodule\n", "module top_module(\n input clk,\n input [7:0] d,\n output reg [7:0] q\n);\n\n always @(posedge clk) begin\n q <= d;\n end\n\nendmodule\n", "module top_module(\n input clk,\n input [7:0] d,\n output reg [7:0] q\n);\n\n always @(posedge clk) begin\n q <= d;\n end\n\nendmodule\n", "module top_module(\n input clk,\n input [7:0] d,\n output reg [7:0] q\n);\n always @(posedge clk) begin\n q <= d;\n end\nendmodule\n", "module top_module(\n input clk,\n input [7:0] d,\n output reg [7:0] q\n);\n always @(posedge clk) begin\n q <= d;\n end\nendmodule\n", "module top_module(\n input clk,\n input [7:0] d,\n output reg [7:0] q\n);\n always @(posedge clk) begin\n q <= d;\n end\nendmodule\n", "module top_module(\n input clk,\n input [7:0] d,\n output reg [7:0] q);\n\n always @(posedge clk) begin\n q <= d;\n end\n\nendmodule\n", "module top_module(\n input clk,\n input [7:0] d,\n output reg [7:0] q\n);\n always @(posedge clk) begin\n q <= d;\n end\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput [7:0] d,\n\toutput reg [7:0] q);\n\n\talways @(posedge clk) begin\n\t\tq <= d;\n\tend\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput [7:0] d,\n\toutput reg [7:0] q);\n\n\talways @(posedge clk) begin\n\t\tq <= d;\n\tend\n\t\nendmodule\n", "module top_module(\n input clk,\n input [7:0] d,\n output reg [7:0] q\n);\n always @(posedge clk) begin\n q <= d;\n end\nendmodule\n", "module top_module(\n input clk,\n input [7:0] d,\n output reg [7:0] q\n);\n always @(posedge clk) begin\n q <= d;\n end\nendmodule\n", "module top_module(\n input clk,\n input [7:0] d,\n output reg [7:0] q);\n\n always @(posedge clk) begin\n q <= d;\n end\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput [7:0] d,\n\toutput reg [7:0] q);\n\n\talways @(posedge clk) begin\n\t\tq <= d;\n\tend\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput [7:0] d,\n\toutput reg [7:0] q);\n\n\talways @(posedge clk) begin\n\t\tq <= d;\n\tend\n\nendmodule\n", "module top_module(\n input clk,\n input [7:0] d,\n output reg [7:0] q);\n\n always @(posedge clk) begin\n q <= d;\n end\n\nendmodule\n", "module top_module(\n input clk,\n input [7:0] d,\n output reg [7:0] q\n);\n always @(posedge clk) begin\n q <= d;\n end\nendmodule\n", "module top_module(\n input clk,\n input [7:0] d,\n output reg [7:0] q\n);\n always @(posedge clk) begin\n q <= d;\n end\nendmodule\n", "module top_module(\n input clk,\n input [7:0] d,\n output reg [7:0] q\n);\n always @(posedge clk) begin\n q <= d;\n end\nendmodule\n"]}
{"task_id": "ece241_2014_q1c", "llmgen_RTL": ["module top_module (\n input [7:0] a,\n input [7:0] b,\n output [7:0] s,\n output overflow\n);\n wire [8:0] sum; // using an extra bit to capture overflow\n assign sum = {1'b0, a} + {1'b0, b}; // sign-extend for addition\n assign s = sum[7:0]; // take lower 8 bits as the result\n assign overflow = (a[7] == b[7]) && (s[7] != a[7]); // overflow condition\nendmodule\n", "module top_module (\n input [7:0] a,\n input [7:0] b,\n output [7:0] s,\n output overflow\n);\n wire [8:0] sum; // 9 bits to accommodate overflow\n assign sum = {1'b0, a} + {1'b0, b}; // Extend to 9 bits and add\n assign s = sum[7:0]; // Lower 8 bits are the sum\n assign overflow = (a[7] == b[7]) && (s[7] != a[7]); // Check for overflow condition\nendmodule\n", "module top_module (\n\tinput [7:0] a,\n\tinput [7:0] b,\n\toutput [7:0] s,\n\toutput overflow\n);\n\n\twire signed [8:0] sum; // 9-bit to accommodate overflow\n\tassign sum = $signed(a) + $signed(b);\n\tassign s = sum[7:0];\n\tassign overflow = (a[7] == b[7]) && (s[7] != a[7]);\n\nendmodule\n", "module top_module (\n\tinput [7:0] a,\n\tinput [7:0] b,\n\toutput [7:0] s,\n\toutput overflow\n);\n\twire signed [8:0] sum;\n\tassign sum = $signed(a) + $signed(b);\n\tassign s = sum[7:0];\n\tassign overflow = (sum[8] != sum[7]);\nendmodule\n", "module top_module (\n input [7:0] a,\n input [7:0] b,\n output [7:0] s,\n output overflow\n);\n wire signed [8:0] sum = {1'b0, a} + {1'b0, b};\n \n assign s = sum[7:0];\n assign overflow = (a[7] == b[7]) && (s[7] != a[7]);\nendmodule\n", "module top_module (\n\tinput [7:0] a,\n\tinput [7:0] b,\n\toutput [7:0] s,\n\toutput overflow\n);\n\n\twire [8:0] sum;\n\tassign sum = {1'b0, a} + {1'b0, b};\n\tassign s = sum[7:0];\n\tassign overflow = (a[7] == b[7]) && (s[7] != a[7]);\n\nendmodule\n", "module top_module (\n\tinput [7:0] a,\n\tinput [7:0] b,\n\toutput [7:0] s,\n\toutput overflow\n);\n\n wire [8:0] sum;\n assign sum = {1'b0, a} + {1'b0, b}; // Extend to 9 bits to capture overflow\n assign s = sum[7:0];\n assign overflow = (a[7] == b[7]) && (s[7] != a[7]); // Check for overflow\n\nendmodule\n", "module top_module (\n\tinput [7:0] a,\n\tinput [7:0] b,\n\toutput [7:0] s,\n\toutput overflow\n);\n\twire [8:0] sum;\n\tassign sum = {1'b0, a} + {1'b0, b}; // 9-bit to detect overflow\n\tassign s = sum[7:0];\n\tassign overflow = (a[7] == b[7]) && (s[7] != a[7]);\nendmodule\n", "module top_module (\n\tinput [7:0] a,\n\tinput [7:0] b,\n\toutput [7:0] s,\n\toutput overflow\n);\n wire [8:0] sum;\n assign sum = {1'b0, a} + {1'b0, b}; // Extend to 9 bits to check for overflow\n assign s = sum[7:0];\n assign overflow = (a[7] == b[7]) && (s[7] != a[7]);\nendmodule\n", "module top_module (\n\tinput [7:0] a,\n\tinput [7:0] b,\n\toutput [7:0] s,\n\toutput overflow\n);\n wire [8:0] sum; // 9 bits to capture overflow\n assign sum = {1'b0, a} + {1'b0, b}; // Extend to 9 bits for overflow checking\n assign s = sum[7:0]; // Result is the lower 8 bits\n assign overflow = (a[7] == b[7]) && (a[7] != s[7]); // Overflow detection\nendmodule\n", "module top_module (\n\tinput [7:0] a,\n\tinput [7:0] b,\n\toutput [7:0] s,\n\toutput overflow\n);\n wire signed [8:0] signed_a;\n wire signed [8:0] signed_b;\n wire signed [8:0] signed_s;\n\n assign signed_a = {a[7], a}; // sign extend a\n assign signed_b = {b[7], b}; // sign extend b\n assign signed_s = signed_a + signed_b;\n assign s = signed_s[7:0]; // lower 8 bits for the sum\n assign overflow = (signed_a[8] == signed_b[8]) && (signed_s[8] != signed_a[8]); // overflow condition\n\nendmodule\n", "module top_module (\n\tinput [7:0] a,\n\tinput [7:0] b,\n\toutput [7:0] s,\n\toutput overflow\n);\n\n\twire [8:0] sum; // 9-bit to capture carry\n\tassign sum = {1'b0, a} + {1'b0, b}; // Extend to 9 bits for addition\n\tassign s = sum[7:0]; // 8-bit sum output\n\tassign overflow = (a[7] == b[7]) && (s[7] != a[7]); // Check for overflow\n\nendmodule\n", "module top_module (\n\tinput [7
{"task_id": "review2015_fsmonehot", "llmgen_RTL": ["module top_module(\n input d,\n input done_counting,\n input ack,\n input [9:0] state, // 10-bit one-hot current state\n output B3_next,\n output S_next,\n output S1_next,\n output Count_next,\n output Wait_next,\n output done,\n output counting,\n output shift_ena\n);\n\nassign B3_next = state[9] & 1; // B3 (shift_ena=1) goes to Count\nassign S_next = state[0] & d; // S goes to S1 on d=1\nassign S1_next = state[1] & d; // S1 goes to S11 on d=1\nassign Count_next = state[8] & done_counting; // Count goes to Wait on done_counting=1\nassign Wait_next = state[8] & done_counting & ack; // Wait goes to S on ack=1\nassign done = state[8] & done_counting; // done is 1 when in Count and done_counting=1\nassign counting = state[8]; // counting is 1 when in Count state\nassign shift_ena = state[4] | state[5] | state[6] | state[7]; // B0, B1, B2, B3\n\nendmodule\n", "module top_module(\n input d,\n input done_counting,\n input ack,\n input [9:0] state, // 10-bit one-hot current state\n output B3_next,\n output S_next,\n output S1_next,\n output Count_next,\n output Wait_next,\n output done,\n output counting,\n output shift_ena\n);\n\n // State transitions\n assign S_next = state[0] & d; // S --d=1--> S1\n assign S1_next = state[1] & d; // S1 --d=1--> S11\n assign Count_next = state[8] & done_counting; // Count --(done_counting)--> Wait\n assign Wait_next = state[9] & ack; // Wait --ack=1--> S\n\n assign B3_next = state[7]; // B3 --(shift_ena=1)--> Count\n\n // Output logic\n assign done = state[9]; // Done output logic: Wait state done\n assign counting = state[8]; // Counting output logic: Count state\n assign shift_ena = state[7] | state[8]; // Shift enable: B3 or Count state\n\nendmodule\n", "module top_module(\n input d,\n input done_counting,\n input ack,\n input [9:0] state, // 10-bit one-hot current state\n output B3_next,\n output S_next,\n output S1_next,\n output Count_next,\n output Wait_next,\n output done,\n output counting,\n output shift_ena\n);\n\n assign B3_next = state[9] && 1'b1; // B3 always goes to Count\n assign S_next = state[0] && (d == 1'b1);\n assign S1_next = state[1] && (d == 1'b1);\n assign Count_next = state[8] && !done_counting;\n assign Wait_next = state[9] && done_counting && (ack == 1'b1);\n\n assign done = state[9] && done_counting; // done signal set when in Wait and done_counting is high\n assign counting = state[8]; // counting is asserted when in Count state\n assign shift_ena = state[4] || state[5] || state[6] || state[7]; // shift_ena asserted in B0, B1, B2, B3\n\nendmodule\n", "module top_module(\n input d,\n input done_counting,\n input ack,\n input [9:0] state, // 10-bit one-hot current state\n output B3_next,\n output S_next,\n output S1_next,\n output Count_next,\n output Wait_next,\n output done,\n output counting,\n output shift_ena\n);\n \n // State next logic\n wire S = state[0];\n wire S1 = state[1];\n wire S11 = state[2];\n wire S110 = state[3];\n wire B0 = state[4];\n wire B1 = state[5];\n wire B2 = state[6];\n wire B3 = state[7];\n wire Count = state[8];\n wire Wait = state[9];\n\n assign B3_next = B3 && shift_ena; // B3 -> Count\n assign S_next = S && ~d; // S -> S\n assign S1_next = S1 && d; // S1 -> S1\n assign Count_next = Count && ~done_counting; // Count -> Count\n assign Wait_next = Wait && (done && ack); // Wait -> S\n\n // Output logic\n assign done = Wait && ack; // done logic\n assign counting = Count; // counting logic\n assign shift_ena = B0 || B1 || B2 || B3; // shift_ena logic\n\nendmodule\n", "module top_module(\n input d,\n input done_counting,\n input ack,\n input [
{"task_id": "counter_2bc", "llmgen_RTL": ["module top_module(\n input clk,\n input areset,\n input train_valid,\n input train_taken,\n output logic [1:0] state\n);\n always_ff @(posedge clk or posedge areset) begin\n if (areset) begin\n state <= 2'b01;\n end else if (train_valid) begin\n if (train_taken) begin\n if (state < 2'b11) \n state <= state + 1;\n end else begin\n if (state > 2'b00) \n state <= state - 1;\n end\n end\n end\nendmodule\n", "module top_module(\n input clk,\n input areset,\n input train_valid,\n input train_taken,\n output logic [1:0] state\n);\n\n always_ff @(posedge clk or posedge areset) begin\n if (areset) begin\n state <= 2'b01;\n end else if (train_valid) begin\n if (train_taken) begin\n if (state < 2'b11) begin\n state <= state + 1;\n end\n end else begin\n if (state > 2'b00) begin\n state <= state - 1;\n end\n end\n end\n end\n\nendmodule\n", "module top_module(\n input clk,\n input areset,\n input train_valid,\n input train_taken,\n output logic [1:0] state\n);\n always_ff @(posedge clk or posedge areset) begin\n if (areset) begin\n state <= 2'b01; // Reset to weakly not-taken\n end else if (train_valid) begin\n if (train_taken) begin\n if (state < 2'b11) begin\n state <= state + 1; // Increment (max 3)\n end\n end else begin\n if (state > 2'b00) begin\n state <= state - 1; // Decrement (min 0)\n end\n end\n end\n end\nendmodule\n", "module top_module(\n input clk,\n input areset,\n input train_valid,\n input train_taken,\n output logic [1:0] state\n);\n always_ff @(posedge clk or posedge areset) begin\n if (areset) begin\n state <= 2'b01;\n end else if (train_valid) begin\n if (train_taken && state < 2'b11) begin\n state <= state + 1;\n end else if (!train_taken && state > 2'b00) begin\n state <= state - 1;\n end\n end\n end\nendmodule\n", "module top_module(\n input clk,\n input areset,\n input train_valid,\n input train_taken,\n output logic [1:0] state\n);\n\n always_ff @(posedge clk or posedge areset) begin\n if (areset) begin\n state <= 2'b01; // Reset to weakly not-taken\n end else if (train_valid) begin\n if (train_taken && state < 2'b11) begin\n state <= state + 1; // Increment if train_taken is 1 and not max\n end else if (!train_taken && state > 2'b00) begin\n state <= state - 1; // Decrement if train_taken is 0 and not min\n end\n end\n end\n\nendmodule\n", "module top_module(\n input clk,\n input areset,\n input train_valid,\n input train_taken,\n output logic [1:0] state\n);\n always_ff @(posedge clk or posedge areset) begin\n if (areset) begin\n state <= 2'b01;\n end else if (train_valid) begin\n if (train_taken) begin\n if (state < 2'b11) \n state <= state + 1;\n end else begin\n if (state > 2'b00)\n state <= state - 1;\n end\n end\n end\nendmodule\n", "module top_module(\n input clk,\n input areset,\n input train_valid,\n input train_taken,\n output logic [1:0] state\n);\n always_ff @(posedge clk or posedge areset) begin\n if (areset) begin\n state <= 2'b01;\n end else if (train_valid) begin\n if (train_taken && state < 2'b11) begin\n state <= state + 1;\n end else if (!train_taken && state > 2'b00) begin
{"task_id": "always_casez", "llmgen_RTL": ["module top_module (\n input [7:0] in,\n output reg [2:0] pos\n);\n always @(*) begin\n pos = 3'd0; // Default to 0 if no bits are high\n case (in)\n 8'b00000001: pos = 3'd0;\n 8'b00000010: pos = 3'd1;\n 8'b00000100: pos = 3'd2;\n 8'b00001000: pos = 3'd3;\n 8'b00010000: pos = 3'd4;\n 8'b00100000: pos = 3'd5;\n 8'b01000000: pos = 3'd6;\n 8'b10000000: pos = 3'd7;\n endcase\n end\nendmodule\n", "module top_module (\n\tinput [7:0] in,\n\toutput reg [2:0] pos\n);\n\nalways @* begin\n\tpos = 3'b000; // Default output when no bits are high\n\tcase (in)\n\t\t8'b00000000: pos = 3'b000; // No bits high\n\t\t8'b00000001: pos = 3'b000; // Bit 0 high\n\t\t8'b00000010: pos = 3'b001; // Bit 1 high\n\t\t8'b00000100: pos = 3'b010; // Bit 2 high\n\t\t8'b00001000: pos = 3'b011; // Bit 3 high\n\t\t8'b00010000: pos = 3'b100; // Bit 4 high\n\t\t8'b00100000: pos = 3'b101; // Bit 5 high\n\t\t8'b01000000: pos = 3'b110; // Bit 6 high\n\t\t8'b10000000: pos = 3'b111; // Bit 7 high\n\t\tdefault: begin\n\t\t\tif (in[0]) pos = 3'b000;\n\t\t\telse if (in[1]) pos = 3'b001;\n\t\t\telse if (in[2]) pos = 3'b010;\n\t\t\telse if (in[3]) pos = 3'b011;\n\t\t\telse if (in[4]) pos = 3'b100;\n\t\t\telse if (in[5]) pos = 3'b101;\n\t\t\telse if (in[6]) pos = 3'b110;\n\t\t\telse if (in[7]) pos = 3'b111;\n\t\tend\n\tendcase\nend\n\nendmodule\n", "module top_module (\n\tinput [7:0] in,\n\toutput reg [2:0] pos\n);\n\nalways @(*) begin\n\tpos = 3'b000; // Default output\n\tcase (in)\n\t\t8'b00000001: pos = 3'd0; \n\t\t8'b00000010: pos = 3'd1; \n\t\t8'b00000100: pos = 3'd2; \n\t\t8'b00001000: pos = 3'd3; \n\t\t8'b00010000: pos = 3'd4; \n\t\t8'b00100000: pos = 3'd5; \n\t\t8'b01000000: pos = 3'd6; \n\t\t8'b10000000: pos = 3'd7; \n\t\tdefault: pos = 3'b000; // If no bits are high\n\tendcase\nend\n\nendmodule\n", "module top_module (\n\tinput [7:0] in,\n\toutput reg [2:0] pos\n);\n\talways @(*) begin\n\t\tpos = 3'b000; // Default to zero\n\t\tcase (in)\n\t\t\t8'b00000001: pos = 3'd0;\n\t\t\t8'b00000010: pos = 3'd1;\n\t\t\t8'b00000100: pos = 3'd2;\n\t\t\t8'b00001000: pos = 3'd3;\n\t\t\t8'b00010000: pos = 3'd4;\n\t\t\t8'b00100000: pos = 3'd5;\n\t\t\t8'b01000000: pos = 3'd6;\n\t\t\t8'b10000000: pos = 3'd7;\n\t\t\tdefault: pos = 3'b000; // No bits high\n\t\tendcase\n\tend\nendmodule\n", "module top_module (\n input [7:0] in,\n output reg [2:0] pos\n);\n integer i;\n\n always @(*) begin\n pos = 3'b0; // Default value if no bits are high\n for (i = 0; i < 8; i = i + 1) begin\n if (in[i] == 1) begin\n pos = i[2:0]; // Report the position of the first high bit\n break;\n end\n end\n end\nendmodule\n", "module top_module (\n input [7:0] in,\n output reg [2:0] pos\n);\n integer i;\n\n always @(*) begin\n pos = 3'b000; // Default to zero\n for (i = 0; i < 8; i = i + 1) begin\n if (in[i]) begin\n pos = i[2:0]; // Store the position of the first 1\n break;\n end\n end\n end\nendmodule\n", "module top_module (\n\tinput [7:0] in,\n\toutput reg [2:0] pos\n);\n\n\talways @(*) begin\n\t\tpos = 3'b000; // Default to 0 (no bits are high)\n\t\tif (in[0]) pos = 3'd0;\n\t\telse if (in[1]) pos = 3'd1;\n\t\telse if (in[2]) pos = 3'd2;\n\t\telse if (in[3]) pos = 3'd3;\n\t\telse if (in[4]) pos = 3'd4;\n\t\telse if (in[5]) pos = 3'd5;\n\t\telse if (in[6]) pos = 3'd6;\n\t\telse if (in[7]) pos = 3'd7;\n\tend\n\t\nendmodule\n", "module top_module (\n input [7:0] in,\n output reg [2:0] pos\n);\n\n always @* begin\n pos = 3'b000; // Default output if no bits are high\n casez (in)\n 8'b1???????: pos = 3'd0;\n 8'b01??????: pos = 3'd1;\n 8'b001?????: pos = 3'd2;\n 8'b0001????: pos = 3'd3;\n 8'b00001???: pos = 3'd4;\n 8'b000001??: pos = 3'd5;\n 8'b0000001?: pos = 3'd6;\n
{"task_id": "always_nolatches", "llmgen_RTL": ["module top_module (\n\tinput [15:0] scancode,\n\toutput reg left,\n\toutput reg down,\n\toutput reg right,\n\toutput reg up\n);\n\n\talways @(*) begin\n\t\t// Initialize outputs to 0\n\t\tleft = 0;\n\t\tdown = 0;\n\t\tright = 0;\n\t\tup = 0;\n\t\t\n\t\t// Check the scancode for arrow keys\n\t\tcase (scancode)\n\t\t\t16'hE06B: left = 1; // Left arrow\n\t\t\t16'hE072: down = 1; // Down arrow\n\t\t\t16'hE074: right = 1; // Right arrow\n\t\t\t16'hE075: up = 1; // Up arrow\n\t\t\tdefault: ; // None, outputs remain 0\n\t\tendcase\n\tend\n\nendmodule\n", "module top_module (\n input [15:0] scancode,\n output reg left,\n output reg down,\n output reg right,\n output reg up\n);\n\n always @(*) begin\n left = 0;\n down = 0;\n right = 0;\n up = 0;\n \n case (scancode)\n 16'hE06B: left = 1;\n 16'hE072: down = 1;\n 16'hE074: right = 1;\n 16'hE075: up = 1;\n default: ; // do nothing\n endcase\n end\n\nendmodule\n", "module top_module (\n\tinput [15:0] scancode,\n\toutput reg left,\n\toutput reg down,\n\toutput reg right,\n\toutput reg up\n);\n\n\talways @* begin\n\t\tleft = 0;\n\t\tdown = 0;\n\t\tright = 0;\n\t\tup = 0;\n\n\t\tcase (scancode)\n\t\t\t16'hE06B: left = 1;\n\t\t\t16'hE072: down = 1;\n\t\t\t16'hE074: right = 1;\n\t\t\t16'hE075: up = 1;\n\t\t\tdefault: ;\n\t\tendcase\n\tend\n\nendmodule\n", "module top_module (\n\tinput [15:0] scancode,\n\toutput reg left,\n\toutput reg down,\n\toutput reg right,\n\toutput reg up\n);\n\nalways @* begin\n\tleft = 0;\n\tdown = 0;\n\tright = 0;\n\tup = 0;\n\n\tcase (scancode)\n\t\t16'hE06B: left = 1;\n\t\t16'hE072: down = 1;\n\t\t16'hE074: right = 1;\n\t\t16'hE075: up = 1;\n\t\tdefault: begin\n\t\t\tleft = 0;\n\t\t\tdown = 0;\n\t\t\tright = 0;\n\t\t\tup = 0;\n\t\tend\n\tendcase\nend\n\nendmodule\n", "module top_module (\n input [15:0] scancode,\n output reg left,\n output reg down,\n output reg right,\n output reg up\n);\n\n always @(*) begin\n // Initialize outputs\n left = 0;\n down = 0;\n right = 0;\n up = 0;\n\n case (scancode)\n 16'hE06B: left = 1; // left arrow\n 16'hE072: down = 1; // down arrow\n 16'hE074: right = 1; // right arrow\n 16'hE075: up = 1; // up arrow\n default: ; // none\n endcase\n end\n\nendmodule\n", "module top_module (\n\tinput [15:0] scancode,\n\toutput reg left,\n\toutput reg down,\n\toutput reg right,\n\toutput reg up\n);\n\nalways @(*) begin\n\tleft = 0;\n\tdown = 0;\n\tright = 0;\n\tup = 0;\n\n\tcase(scancode)\n\t\t16'hE06B: left = 1;\n\t\t16'hE072: down = 1;\n\t\t16'hE074: right = 1;\n\t\t16'hE075: up = 1;\n\t\tdefault: begin\n\t\t\tleft = 0;\n\t\t\tdown = 0;\n\t\t\tright = 0;\n\t\t\tup = 0;\n\t\tend\n\tendcase\nend\n\nendmodule\n", "module top_module (\n input [15:0] scancode,\n output reg left,\n output reg down,\n output reg right,\n output reg up\n);\n\n always @* begin\n // Initialize outputs to 0\n left = 0;\n down = 0;\n right = 0;\n up = 0;\n\n // Check the scancode for arrow key presses\n case (scancode)\n 16'hE06B: left = 1; // Left arrow\n 16'hE072: down = 1; // Down arrow\n 16'hE074: right = 1; // Right arrow\n 16'hE075: up = 1; // Up arrow\n default: ; // None\n endcase\n end\nendmodule\n", "module top_module (\n input [15:0] scancode,\n output reg left,\n output reg down,\n output reg right,\n output reg up\n);\n\n always @* begin\n // Initialize outputs to 0\n left = 0;\n down = 0;\n right = 0;\n up = 0;\n\n // Check for specific scancodes\n case (scancode)\n 16'hE06B: left = 1; // left arrow\n 16'hE072: down = 1; // down arrow\n 16'hE074: right = 1; // right
{"task_id": "m2014_q4j", "llmgen_RTL": ["module top_module (\n\tinput [3:0] x,\n\tinput [3:0] y,\n\toutput [4:0] sum\n);\n\twire c1, c2, c3; // carry wires\n\n\t// Full adder for bit 0\n\tassign sum[0] = x[0] ^ y[0];\n\tassign c1 = x[0] & y[0];\n\n\t// Full adder for bit 1\n\tassign sum[1] = x[1] ^ y[1] ^ c1;\n\tassign c2 = (x[1] & y[1]) | (c1 & (x[1] ^ y[1]));\n\n\t// Full adder for bit 2\n\tassign sum[2] = x[2] ^ y[2] ^ c2;\n\tassign c3 = (x[2] & y[2]) | (c2 & (x[2] ^ y[2]));\n\n\t// Full adder for bit 3\n\tassign sum[3] = x[3] ^ y[3] ^ c3;\n\tassign sum[4] = (x[3] & y[3]) | (c3 & (x[3] ^ y[3]));\n\nendmodule\n", "module top_module (\n input [3:0] x,\n input [3:0] y,\n output [4:0] sum\n);\n\n wire [3:0] carry;\n\n full_adder fa0 (\n .a(x[0]),\n .b(y[0]),\n .cin(1'b0),\n .sum(sum[0]),\n .cout(carry[0])\n );\n\n full_adder fa1 (\n .a(x[1]),\n .b(y[1]),\n .cin(carry[0]),\n .sum(sum[1]),\n .cout(carry[1])\n );\n\n full_adder fa2 (\n .a(x[2]),\n .b(y[2]),\n .cin(carry[1]),\n .sum(sum[2]),\n .cout(carry[2])\n );\n\n full_adder fa3 (\n .a(x[3]),\n .b(y[3]),\n .cin(carry[2]),\n .sum(sum[3]),\n .cout(sum[4])\n );\n\nendmodule\n\nmodule full_adder (\n input a,\n input b,\n input cin,\n output sum,\n output cout\n);\n assign sum = a ^ b ^ cin;\n assign cout = (a & b) | (cin & (a ^ b));\nendmodule\n", "module top_module (\n\tinput [3:0] x,\n\tinput [3:0] y,\n\toutput [4:0] sum\n);\n\n\twire c1, c2, c3;\n wire s0, s1, s2, s3;\n\n // Full adder for the least significant bit\n assign s0 = x[0] ^ y[0];\n assign sum[0] = s0 ^ 0; // No carry in for the LSB\n assign c1 = (x[0] & y[0]) | (s0 & 0);\n\n // Full adder for the second bit\n assign s1 = x[1] ^ y[1];\n assign sum[1] = s1 ^ c1;\n assign c2 = (x[1] & y[1]) | (s1 & c1);\n\n // Full adder for the third bit\n assign s2 = x[2] ^ y[2];\n assign sum[2] = s2 ^ c2;\n assign c3 = (x[2] & y[2]) | (s2 & c2);\n\n // Full adder for the most significant bit\n assign sum[3] = x[3] ^ y[3] ^ c3;\n assign sum[4] = (x[3] & y[3]) | (c3 & (x[3] ^ y[3]));\n\nendmodule\n", "module top_module (\n input [3:0] x,\n input [3:0] y,\n output [4:0] sum\n);\n wire [3:0] carry;\n\n // Full Adder for the Least Significant Bit (LSB)\n assign sum[0] = x[0] ^ y[0];\n assign carry[0] = x[0] & y[0];\n\n // Full Adder for the second bit\n assign sum[1] = x[1] ^ y[1] ^ carry[0];\n assign carry[1] = (x[1] & y[1]) | (carry[0] & (x[1] ^ y[1]));\n\n // Full Adder for the third bit\n assign sum[2] = x[2] ^ y[2] ^ carry[1];\n assign carry[2] = (x[2] & y[2]) | (carry[1] & (x[2] ^ y[2]));\n\n // Full Adder for the Most Significant Bit (MSB)\n assign sum[3] = x[3] ^ y[3] ^ carry[2];\n assign sum[4] = (x[3] & y[3]) | (carry[2] & (x[3] ^ y[3]));\n\nendmodule\n", "module top_module (\n\tinput [3:0] x,\n\tinput [3:0] y,\n\toutput [4:0] sum\n);\n\twire c1, c2, c3; // Carry wires\n\n\tfull_adder fa0 (.a(x[0]), .b(y[0]), .cin(1'b0), .sum(sum[0]), .cout(c1));\n\tfull_adder fa1 (.a(x[1]), .b(y[1]), .cin(c1), .sum(sum[1]), .cout(c2));\n\tfull_adder fa2 (.a(x[2]), .b(y[2]), .cin(c2), .sum(sum[2]), .cout(c3));\n\tfull_adder fa3 (.a(x[3]), .b(y[3]), .cin(c3), .sum(sum[3]), .cout(sum[4]));\n\nendmodule\n\nmodule full_adder (\n\tinput a,\n\tinput b,\n\tinput cin,\n\toutput sum,\n\toutput cout\n);\n\tassign sum = a ^ b ^ cin;\n\tassign cout = (a & b) | (cin & (a ^ b));\nendmodule\n", "module top_module (\n\tinput [3:0] x,\n\tinput [3:0] y,\n\toutput [4:0] sum\n);\n\n\twire c1, c2, c3; // carry wires\n\n\tfull_adder fa0 (.a(x[0]), .b(y[0]), .cin(1'b0), .sum(sum[0]), .cout(c1));\n\tfull_adder fa1 (.a(x[1]), .b(y[1]), .cin(c1), .sum(sum[1]), .cout(c2));\n\tfull_adder fa2 (.a(x[2]), .b(y[2]), .cin(c2), .sum(sum[2]), .cout(c3));\n\tfull_adder fa3 (.a(x[3]), .b(y[3]), .cin(c3), .sum(sum[3]), .cout(sum[4])); // overflow bit as carry out\n\nendmodule\n\nmodule fu
{"task_id": "history_shift", "llmgen_RTL": ["module top_module\n(\n input clk,\n input areset,\n input predict_valid,\n input predict_taken,\n output logic [31:0] predict_history,\n \n input train_mispredicted,\n input train_taken,\n input [31:0] train_history\n);\n\n logic [31:0] history;\n\n always_ff @(posedge clk or negedge areset) begin\n if (!areset) begin\n history <= 32'b0;\n end else if (train_mispredicted) begin\n history <= {train_history[31:0], train_taken};\n end else if (predict_valid) begin\n history <= {history[30:0], predict_taken};\n end\n end\n\n assign predict_history = history;\n\nendmodule\n", "module top_module\n(\n input clk,\n input areset,\n input predict_valid,\n input predict_taken,\n output logic [31:0] predict_history,\n \n input train_mispredicted,\n input train_taken,\n input [31:0] train_history\n);\n\n logic [31:0] history_reg;\n\n always_ff @(posedge clk or negedge areset) begin\n if (!areset) begin\n history_reg <= 32'b0;\n end else if (train_mispredicted) begin\n history_reg <= {train_history[31:1], train_taken};\n end else if (predict_valid) begin\n history_reg <= {history_reg[30:0], predict_taken};\n end\n end\n\n assign predict_history = history_reg;\n\nendmodule\n", "module top_module\n(\n input clk,\n input areset,\n input predict_valid,\n input predict_taken,\n output logic [31:0] predict_history,\n \n input train_mispredicted,\n input train_taken,\n input [31:0] train_history\n);\n\n logic [31:0] history;\n\n always_ff @(posedge clk or posedge areset) begin\n if (areset) begin\n history <= 32'b0;\n end else if (train_mispredicted) begin\n history <= {train_history[30:0], train_taken};\n end else if (predict_valid) begin\n history <= {history[30:0], predict_taken};\n end\n end\n\n assign predict_history = history;\n\nendmodule\n", "module top_module\n(\n input clk,\n input areset,\n input predict_valid,\n input predict_taken,\n output logic [31:0] predict_history,\n \n input train_mispredicted,\n input train_taken,\n input [31:0] train_history\n);\n\n logic [31:0] history_reg;\n\n always_ff @(posedge clk or posedge areset) begin\n if (areset) begin\n history_reg <= 32'b0;\n end else if (train_mispredicted) begin\n history_reg <= {train_history[31:1], train_taken};\n end else if (predict_valid) begin\n history_reg <= {history_reg[30:0], predict_taken};\n end\n end\n\n assign predict_history = history_reg;\n\nendmodule\n", "module top_module\n(\n input clk,\n input areset,\n input predict_valid,\n input predict_taken,\n output logic [31:0] predict_history,\n \n input train_mispredicted,\n input train_taken,\n input [31:0] train_history\n);\n\n logic [31:0] history_reg;\n\n always_ff @(posedge clk or posedge areset) begin\n if (areset) begin\n history_reg <= 32'b0;\n end else if (train_mispredicted) begin\n history_reg <= {train_history[31:1], train_taken};\n end else if (predict_valid) begin\n history_reg <= {history_reg[30:0], predict_taken};\n end\n end\n\n assign predict_history = history_reg;\n\nendmodule\n", "module top_module\n(\n input clk,\n input areset,\n input predict_valid,\n input predict_taken,\n output logic [31:0] predict_history,\n \n input train_mispredicted,\n input train_taken,\n input [31:0] train_history\n);\n\n logic [31:0] history_reg;\n\n always_ff @(posedge clk or posedge areset) begin\n if (areset) begin\n history_reg <= 32'b0;\n end else if (train_mispredicted) begin\n history_reg <= {train_history[30:0], train_taken}; // Load the history after completion of mispredicted branch\n end els
{"task_id": "wire_decl", "llmgen_RTL": ["module top_module (\n input a,\n input b,\n input c,\n input d,\n output out,\n output out_n\n);\n wire and1_out;\n wire and2_out;\n\n assign and1_out = a & b;\n assign and2_out = c & d;\n assign out = and1_out | and2_out;\n assign out_n = ~out;\n\nendmodule\n", "module top_module (\n input a,\n input b,\n input c,\n input d,\n output out,\n output out_n \n);\n wire and1_out;\n wire and2_out;\n\n assign and1_out = a & b;\n assign and2_out = c & d;\n\n assign out = and1_out | and2_out;\n assign out_n = ~out;\n\nendmodule\n", "module top_module (\n\tinput a,\n\tinput b,\n\tinput c,\n\tinput d,\n\toutput out,\n\toutput out_n );\n\n\twire and1_out;\n\twire and2_out;\n\n\tassign and1_out = a & b;\n\tassign and2_out = c & d;\n\tassign out = and1_out | and2_out;\n\tassign out_n = ~out;\n\nendmodule\n", "module top_module (\n input a,\n input b,\n input c,\n input d,\n output out,\n output out_n\n);\n wire and1_out;\n wire and2_out;\n\n and(and1_out, a, b);\n and(and2_out, c, d);\n or(out, and1_out, and2_out);\n not(out_n, out);\nendmodule\n", "module top_module (\n input a,\n input b,\n input c,\n input d,\n output out,\n output out_n\n);\n wire and1_output;\n wire and2_output;\n\n assign and1_output = a & b;\n assign and2_output = c & d;\n assign out = and1_output | and2_output;\n assign out_n = ~out;\n\nendmodule\n", "module top_module (\n\tinput a,\n\tinput b,\n\tinput c,\n\tinput d,\n\toutput out,\n\toutput out_n );\n\n\twire and1_out; // Intermediate wire for the first AND gate\n\twire and2_out; // Intermediate wire for the second AND gate\n\n\tassign and1_out = a & b; // First AND gate\n\tassign and2_out = c & d; // Second AND gate\n\tassign out = and1_out | and2_out; // OR gate\n\tassign out_n = ~out; // Inverted output\n\nendmodule\n", "module top_module (\n input a,\n input b,\n input c,\n input d,\n output out,\n output out_n\n);\n wire and1_out;\n wire and2_out;\n\n and and1(and1_out, a, b);\n and and2(and2_out, c, d);\n or or1(out, and1_out, and2_out);\n not not1(out_n, out);\nendmodule\n", "module top_module (\n input a,\n input b,\n input c,\n input d,\n output out,\n output out_n\n);\n\nwire and1_out;\nwire and2_out;\n\nand AND1 (and1_out, a, b);\nand AND2 (and2_out, c, d);\nor OR1 (out, and1_out, and2_out);\nnot NOT1 (out_n, out);\n\nendmodule\n", "module top_module (\n\tinput a,\n\tinput b,\n\tinput c,\n\tinput d,\n\toutput out,\n\toutput out_n );\n\n\twire and1_out;\n\twire and2_out;\n\n\tand u1(and1_out, a, b);\n\tand u2(and2_out, c, d);\n\tor u3(out, and1_out, and2_out);\n\tnot u4(out_n, out);\n\nendmodule\n", "module top_module (\n input a,\n input b,\n input c,\n input d,\n output out,\n output out_n\n);\n wire and1_out;\n wire and2_out;\n\n assign and1_out = a & b;\n assign and2_out = c & d;\n assign out = and1_out | and2_out;\n assign out_n = ~out;\n\nendmodule\n", "module top_module (\n input a,\n input b,\n input c,\n input d,\n output out,\n output out_n\n);\n\nwire and1_out;\nwire and2_out;\n\nand AND1(and1_out, a, b);\nand AND2(and2_out, c, d);\nor OR1(out, and1_out, and2_out);\nnot NOT1(out_n, out);\n\nendmodule\n", "module top_module (\n\tinput a,\n\tinput b,\n\tinput c,\n\tinput d,\n\toutput out,\n\toutput out_n );\n\n\twire and1_out;\n\twire and2_out;\n\n\tassign and1_out = a & b; // AND gate for inputs a and b\n\tassign and2_out = c & d; // AND gate for inputs c and d\n\tassign out = and1_out | and2_out; // OR gate for the outputs of the AND gates\n\tassign out_n = ~out; // Inverted output\n\nendmodule\n", "module top_module (\n input a,\n input b,\n input c,\n input d,\n output out,\n output out_n\n);\n wire and1_out;\n wire and2_out;\n\n assign and1_out = a & b;\n assign and2_out = c & d;\n assign out = and1_out | and2_out;\n assign out_n = ~out;\n\nendmodul
{"task_id": "dff", "llmgen_RTL": ["module top_module(\n\tinput clk,\n\tinput d,\n\toutput reg q);\n\n\talways @(posedge clk) begin\n\t\tq <= d;\n\tend\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput d,\n\toutput reg q);\n\n\talways @(posedge clk) begin\n\t\tq <= d;\n\tend\n\nendmodule\n", "module top_module(\n input clk,\n input d,\n output reg q);\n\n always @(posedge clk) begin\n q <= d;\n end\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput d,\n\toutput reg q);\n\n\talways @(posedge clk) begin\n\t\tq <= d;\n\tend\n\nendmodule\n", "module top_module(\n input clk,\n input d,\n output reg q);\n\n always @(posedge clk) begin\n q <= d;\n end\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput d,\n\toutput reg q);\n\n\talways @(posedge clk) begin\n\t\tq <= d;\n\tend\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput d,\n\toutput reg q);\n\n\talways @(posedge clk) begin\n\t\tq <= d;\n\tend\n\nendmodule\n", "module top_module(\n input clk,\n input d,\n output reg q\n);\n always @(posedge clk) begin\n q <= d;\n end\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput d,\n\toutput reg q);\n\n\talways @(posedge clk) begin\n\t\tq <= d;\n\tend\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput d,\n\toutput reg q);\n\n\talways @(posedge clk) begin\n\t\tq <= d;\n\tend\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput d,\n\toutput reg q);\n\n\talways @(posedge clk) begin\n\t\tq <= d;\n\tend\nendmodule\n", "module top_module(\n input clk,\n input d,\n output reg q);\n\n always @(posedge clk) begin\n q <= d;\n end\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput d,\n\toutput reg q);\n\n\talways @(posedge clk) begin\n\t\tq <= d;\n\tend\n\nendmodule\n", "module top_module(\n input clk,\n input d,\n output reg q\n);\n always @(posedge clk) begin\n q <= d;\n end\nendmodule\n", "module top_module(\n input clk,\n input d,\n output reg q);\n\n always @(posedge clk) begin\n q <= d;\n end\n\nendmodule\n", "module top_module(\n input clk,\n input d,\n output reg q\n);\n always @(posedge clk) begin\n q <= d;\n end\nendmodule\n", "module top_module(\n input clk,\n input d,\n output reg q);\n\n always @(posedge clk) begin\n q <= d;\n end\n\nendmodule\n", "module top_module(\n input clk,\n input d,\n output reg q);\n\n always @(posedge clk) begin\n q <= d;\n end\n\nendmodule\n", "module top_module(\n input clk,\n input d,\n output reg q);\n\n always @(posedge clk) begin\n q <= d;\n end\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput d,\n\toutput reg q);\n\n\talways @(posedge clk) begin\n\t\tq <= d;\n\tend\n\nendmodule\n"]}
{"task_id": "ece241_2013_q12", "llmgen_RTL": ["module top_module (\n\tinput clk,\n\tinput enable,\n\tinput S,\n\tinput A,\n\tinput B,\n\tinput C,\n\toutput reg Z\n);\n\n reg [7:0] Q;\n\n always @(posedge clk) begin\n if (enable) begin\n Q <= {S, Q[7:1]}; // Shift in S to Q[0]\n end\n end\n\n always @(*) begin\n case ({A, B, C})\n 3'b000: Z = Q[0];\n 3'b001: Z = Q[1];\n 3'b010: Z = Q[2];\n 3'b011: Z = Q[3];\n 3'b100: Z = Q[4];\n 3'b101: Z = Q[5];\n 3'b110: Z = Q[6];\n 3'b111: Z = Q[7];\n default: Z = 1'b0; // Default case (should not occur)\n endcase\n end\nendmodule\n", "module top_module (\n input clk,\n input enable,\n input S,\n input A,\n input B,\n input C,\n output reg Z\n);\n reg [7:0] Q;\n\n always @(posedge clk) begin\n if (enable) begin\n Q <= {S, Q[7:1]}; // Shift in S, shift Q right\n end\n end\n\n always @(*) begin\n case ({A, B, C})\n 3'b000: Z = Q[0];\n 3'b001: Z = Q[1];\n 3'b010: Z = Q[2];\n 3'b011: Z = Q[3];\n 3'b100: Z = Q[4];\n 3'b101: Z = Q[5];\n 3'b110: Z = Q[6];\n 3'b111: Z = Q[7];\n default: Z = 1'b0; // Default case\n endcase\n end\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput enable,\n\tinput S,\n\tinput A,\n\tinput B,\n\tinput C,\n\toutput reg Z\n);\n reg [7:0] Q;\n\n always @(posedge clk) begin\n if (enable) begin\n Q <= {S, Q[7:1]};\n end\n end\n\n always @(*) begin\n case ({A, B, C})\n 3'b000: Z = Q[0];\n 3'b001: Z = Q[1];\n 3'b010: Z = Q[2];\n 3'b011: Z = Q[3];\n 3'b100: Z = Q[4];\n 3'b101: Z = Q[5];\n 3'b110: Z = Q[6];\n 3'b111: Z = Q[7];\n default: Z = 1'b0; // Default case, shouldn't occur\n endcase\n end\nendmodule\n", "module top_module (\n input clk,\n input enable,\n input S,\n input A,\n input B,\n input C,\n output reg Z\n);\n reg [7:0] Q;\n\n always @(posedge clk) begin\n if (enable) begin\n Q <= {S, Q[7:1]};\n end\n end\n\n always @(*) begin\n case ({A, B, C})\n 3'b000: Z = Q[0];\n 3'b001: Z = Q[1];\n 3'b010: Z = Q[2];\n 3'b011: Z = Q[3];\n 3'b100: Z = Q[4];\n 3'b101: Z = Q[5];\n 3'b110: Z = Q[6];\n 3'b111: Z = Q[7];\n default: Z = 1'b0; // Default case to avoid latches\n endcase\n end\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput enable,\n\tinput S,\n\tinput A,\n\tinput B,\n\tinput C,\n\toutput reg Z\n);\n\n\treg [7:0] Q;\n\n\t// Shift register logic\n\talways @(posedge clk) begin\n\t\tif (enable) begin\n\t\t\tQ <= {S, Q[7:1]}; // Shift right, new bit S goes in Q[0]\n\t\tend\n\tend\n\n\t// Multiplexer for output Z\n\talways @(*) begin\n\t\tcase ({A, B, C})\n\t\t\t3'b000: Z = Q[0];\n\t\t\t3'b001: Z = Q[1];\n\t\t\t3'b010: Z = Q[2];\n\t\t\t3'b011: Z = Q[3];\n\t\t\t3'b100: Z = Q[4];\n\t\t\t3'b101: Z = Q[5];\n\t\t\t3'b110: Z = Q[6];\n\t\t\t3'b111: Z = Q[7];\n\t\t\tdefault: Z = 1'b0; // Default case (should not occur)\n\t\tendcase\n\tend\n\nendmodule\n", "module top_module (\n input clk,\n input enable,\n input S,\n input A,\n input B,\n input C,\n output reg Z\n);\n\n reg [7:0] Q;\n\n always @(posedge clk) begin\n if (enable) begin\n Q <= {S, Q[7:1]}; // Shift in S into Q[0]\n end\n end\n\n always @(*) begin\n case ({A, B, C})\n 3'b000: Z = Q[0];\n 3'b001: Z = Q[1];\n 3'b010: Z = Q[2];\n 3'b011: Z = Q[3];\n 3'b100: Z = Q[4];\n 3'b101: Z = Q[5];\n 3'b110: Z = Q[6];\n 3'b111: Z = Q[7];\n default: Z = 1'b0; // Default case (shouldn't be needed)\n endc
{"task_id": "thermostat", "llmgen_RTL": ["module top_module(\n input mode,\n input too_cold, \n input too_hot,\n input fan_on,\n output heater,\n output aircon,\n output fan\n);\n\n assign heater = mode & too_cold; // Heater on in heating mode when too cold\n assign aircon = ~mode & too_hot; // Air conditioner on in cooling mode when too hot\n assign fan = heater | aircon | fan_on; // Fan on if heater, aircon, or fan_on is set\n\nendmodule\n", "module top_module(\n input mode,\n input too_cold, \n input too_hot,\n input fan_on,\n output reg heater,\n output reg aircon,\n output reg fan\n);\n\nalways @(*) begin\n // Default outputs\n heater = 0;\n aircon = 0;\n fan = 0;\n\n // Control logic based on the inputs\n if (fan_on) begin\n fan = 1;\n end else if (mode) begin // Heating mode\n if (too_cold) begin\n heater = 1;\n fan = 1;\n end\n end else begin // Cooling mode\n if (too_hot) begin\n aircon = 1;\n fan = 1;\n end\n end\nend\n\nendmodule\n", "module top_module(\n\tinput mode,\n\tinput too_cold, \n\tinput too_hot,\n\tinput fan_on,\n\toutput heater,\n\toutput aircon,\n\toutput fan\n);\n\nassign heater = mode && too_cold; // Heater on in heating mode if too cold\nassign aircon = ~mode && too_hot; // Air conditioner on in cooling mode if too hot\nassign fan = heater || aircon || fan_on; // Fan on if heater, aircon, or fan_on is requested\n\nendmodule\n", "module top_module(\n input mode,\n input too_cold, \n input too_hot,\n input fan_on,\n output heater,\n output aircon,\n output fan\n);\n\n assign heater = mode & too_cold; // Heater on if in heating mode and too cold\n assign aircon = ~mode & too_hot; // Air conditioner on if in cooling mode and too hot\n assign fan = heater | aircon | fan_on; // Fan on if heater, aircon, or fan_on is active\n\nendmodule\n", "module top_module(\n input mode,\n input too_cold, \n input too_hot,\n input fan_on,\n output heater,\n output aircon,\n output fan\n);\n assign heater = mode & too_cold; // Heater on when in heating mode and too cold\n assign aircon = ~mode & too_hot; // Air conditioner on when in cooling mode and too hot\n assign fan = heater | aircon | fan_on; // Fan on when heater, air conditioner, or manual fan_on is active\nendmodule\n", "module top_module(\n input mode,\n input too_cold, \n input too_hot,\n input fan_on,\n output heater,\n output aircon,\n output fan\n);\n\nassign heater = mode & too_cold; // Heater on in heating mode when too cold\nassign aircon = ~mode & too_hot; // Air conditioner on in cooling mode when too hot\nassign fan = fan_on | heater | aircon; // Fan on if requested or if heater/aircon is on\n\nendmodule\n", "module top_module(\n input mode,\n input too_cold, \n input too_hot,\n input fan_on,\n output reg heater,\n output reg aircon,\n output reg fan\n);\n\nalways @(*) begin\n heater = 0;\n aircon = 0;\n fan = 0;\n\n if (fan_on) begin\n fan = 1;\n end else if (mode) begin // Heating mode\n if (too_cold) begin\n heater = 1;\n fan = 1;\n end\n end else begin // Cooling mode\n if (too_hot) begin\n aircon = 1;\n fan = 1;\n end\n end\nend\n\nendmodule\n", "module top_module(\n input mode,\n input too_cold, \n input too_hot,\n input fan_on,\n output heater,\n output aircon,\n output fan\n);\n\nassign heater = (mode == 1 && too_cold == 1) || fan_on;\nassign aircon = (mode == 0 && too_hot == 1);\nassign fan = heater || aircon || fan_on;\n\nendmodule\n", "module top_module(\n input mode,\n input too_cold, \n input too_hot,\n input fan_on,\n output heater,\n output aircon,\n output fan\n);\n\n assign heater = mode && too_cold; // Heater on in heating mode if it's too cold\n assign aircon = ~mode && too_hot;
{"task_id": "ece241_2013_q2", "llmgen_RTL": ["module top_module (\n input a,\n input b,\n input c,\n input d,\n output out_sop,\n output out_pos\n);\n\nassign out_sop = (a & ~b & ~c & ~d) | (~a & b & c & d) | (~a & b & ~c & ~d) | (~a & ~b & c & d);\n\nassign out_pos = (~a | b | c | d) & (a | ~b | ~c | ~d) & (a | b | ~c | ~d) & (a | b | c | ~d);\n\nendmodule\n", "module top_module (\n\tinput a,\n\tinput b,\n\tinput c,\n\tinput d,\n\toutput out_sop,\n\toutput out_pos\n);\n\nassign out_sop = (a & ~b & ~c & ~d) | (~a & b & c & d) | (~a & ~b & c & ~d) | (a & b & c & d);\nassign out_pos = (~(a & ~b & ~c & ~d)) & (~(a & b & c & ~d)) & (~(a & b & ~c & d)) & (~(a & ~b & c & d));\n\nendmodule\n", "module top_module (\n input a,\n input b,\n input c,\n input d,\n output out_sop,\n output out_pos\n);\n\n // Sum-of-Products (SOP) implementation for 2, 7, 15\n assign out_sop = (a & ~b & ~c & d) | (~a & b & c & d) | (a & b & c & d);\n\n // Product-of-Sums (POS) implementation for 0, 1, 4, 5, 6, 9, 10, 13, 14\n assign out_pos = (~a | ~b | ~c | ~d) & (~a | ~b | c | ~d) & (~a | b | ~c | ~d) & (a | ~b | ~c | d) & (a | b | ~c | ~d) & (a | b | c | ~d);\n\nendmodule\n", "module top_module (\n input a,\n input b,\n input c,\n input d,\n output out_sop,\n output out_pos\n);\n\n assign out_sop = (a & ~b & ~c & ~d) | (~a & b & c & d) | (a & b & c & d);\n assign out_pos = (~a | b | c | d) & (a | ~b | ~c | d) & (a | b | ~c | ~d);\n\nendmodule\n", "module top_module (\n\tinput a,\n\tinput b,\n\tinput c,\n\tinput d,\n\toutput out_sop,\n\toutput out_pos\n);\n\nwire abcd[3:0]; \nassign abcd[0] = a;\nassign abcd[1] = b;\nassign abcd[2] = c;\nassign abcd[3] = d;\n\n// Sum of Products\nassign out_sop = (abcd == 4'b0010) || // 2\n (abcd == 4'b0111) || // 7\n (abcd == 4'b1111); // 15\n\n// Product of Sums\nassign out_pos = (abcd[3] || ~abcd[2] || ~abcd[1] || ~abcd[0]) && // 0\n (abcd[3] || ~abcd[2] || ~abcd[1] || abcd[0]) && // 1\n (abcd[3] || abcd[2] || ~abcd[1] || ~abcd[0]) && // 4\n (abcd[3] || abcd[2] || ~abcd[1] || abcd[0]) && // 5\n (abcd[3] || abcd[2] || abcd[1] || ~abcd[0]) && // 6\n (~abcd[3] || abcd[2] || ~abcd[1] || abcd[0]) && // 9\n (~abcd[3] || abcd[2] || abcd[1] || ~abcd[0]) && // 10\n (~abcd[3] || ~abcd[2] || abcd[1] || abcd[0]) && // 13\n (~abcd[3] || ~abcd[2] || abcd[1] || ~abcd[0]); // 14\n\nendmodule\n", "module top_module (\n\tinput a,\n\tinput b,\n\tinput c,\n\tinput d,\n\toutput out_sop,\n\toutput out_pos\n);\n\nwire [15:0] in = {a, b, c, d};\n\n// Sum of Products (out_sop): 2 (0010), 7 (0111), 15 (1111)\nassign out_sop = (in == 4'b0010) | (in == 4'b0111) | (in == 4'b1111);\n\n// Product of Sums (out_pos): 0 (0000), 1 (0001), 4 (0100), 5 (0101), 6 (0110), 9 (1001), 10 (1010), 13 (1101), 14 (1110)\nassign out_pos = ~(in[0] & in[1] & in[2] & in[3]); // Combine terms that yield 0\n\nendmodule\n", "module top_module (\n\tinput a,\n\tinput b,\n\tinput c,\n\tinput d,\n\toutput out_sop,\n\toutput out_pos\n);\n\nwire [15:0] inputs = {a, b, c, d};\n\nassign out_sop = (inputs == 4'b0010) || // 2\n (inputs == 4'b0111) || // 7\n (inputs == 4'b1111); // 15\n\nassign out_pos = (inputs[0] && inputs[1] && inputs[2] && ~inputs[3]) || // 0\n (~inputs[0] && ~inputs[1] && inputs[2] && ~inputs[3]) || // 1\n (inputs[0] && ~inputs[1] && ~inputs[2] && inputs[3]) || // 4\n (inputs[0] && ~inputs[1] && inputs[2] && inputs[3]) || // 5\n (inputs[0] && inputs[1] && ~inputs[2] && inputs[3]) || // 6\n (~inputs[0] && inputs[1] && ~inputs[2] && inputs[3]) || // 9\n (~inputs[0] && inputs[1] && inputs[2] && ~inputs[3]) || // 10\n (inputs[0] && inputs[1] && inputs[2] && ~inputs[3]) || // 13\n (inputs[0] && inputs[1] && ~inputs[2] && ~inputs[3]); // 14\n\nendmodule\n", "module to
{"task_id": "lfsr32", "llmgen_RTL": ["module top_module(\n input clk,\n input reset,\n output reg [31:0] q);\n\n always @(posedge clk) begin\n if (reset) begin\n q <= 32'h1;\n end else begin\n // Galois LFSR with taps at 32, 22, 2, and 1\n q <= {q[30:0], q[32] ^ q[21] ^ q[1] ^ q[0]};\n end\n end\nendmodule\n", "module top_module(\n input clk,\n input reset,\n output reg [31:0] q\n);\n always @(posedge clk) begin\n if (reset) \n q <= 32'h1;\n else begin\n // Galois LFSR with taps at 32, 22, 2, and 1\n q <= {q[30:0], (q[31] ^ q[21] ^ q[1] ^ q[0])};\n end\n end\nendmodule\n", "module top_module(\n input clk,\n input reset,\n output reg [31:0] q\n);\n \n always @(posedge clk) begin\n if (reset) begin\n q <= 32'h1;\n end else begin\n q <= {q[30:0], q[31] ^ q[21] ^ q[1] ^ q[0]};\n end\n end\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput reset,\n\toutput reg [31:0] q);\n\n\talways @(posedge clk) begin\n\t\tif (reset) begin\n\t\t\tq <= 32'h1;\n\t\tend else begin\n\t\t\tq <= {q[30:0], q[31] ^ q[21] ^ q[1] ^ q[0]};\n\t\tend\n\tend\nendmodule\n", "module top_module(\n input clk,\n input reset,\n output reg [31:0] q\n);\n \n always @(posedge clk) begin\n if (reset) begin\n q <= 32'h1;\n end else begin\n // Galois LFSR logic with taps at bits 32, 22, 2, and 1\n q <= {q[30:0], q[31] ^ q[21] ^ q[1] ^ q[0]};\n end\n end\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput reset,\n\toutput reg [31:0] q);\n\n\talways @(posedge clk) begin\n\t\tif (reset) begin\n\t\t\tq <= 32'h1;\n\t\tend else begin\n\t\t\tq <= {q[30:0], (q[31] ^ q[21] ^ q[1] ^ q[0])};\n\t\tend\n\tend\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput reset,\n\toutput reg [31:0] q);\n\n\talways @(posedge clk) begin\n\t\tif (reset) begin\n\t\t\tq <= 32'h1;\n\t\tend else begin\n\t\t\tq <= {q[30:0], q[31] ^ q[21] ^ q[1] ^ q[0]};\n\t\tend\n\tend\nendmodule\n", "module top_module(\n input clk,\n input reset,\n output reg [31:0] q\n);\n\n always @(posedge clk) begin\n if (reset) begin\n q <= 32'h1;\n end else begin\n q <= {q[30:0], q[32] ^ q[22] ^ q[2] ^ q[1]};\n end\n end\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput reset,\n\toutput reg [31:0] q);\n\n\talways @(posedge clk) begin\n\t\tif (reset) begin\n\t\t\tq <= 32'h1;\n\t\tend else begin\n\t\t\tq <= {q[30:0], q[32] ^ q[21] ^ q[1] ^ q[0]};\n\t\tend\n\tend\nendmodule\n", "module top_module(\n input clk,\n input reset,\n output reg [31:0] q);\n\n always @(posedge clk) begin\n if (reset) begin\n q <= 32'h1;\n end else begin\n q <= {q[30:0], q[31] ^ q[21] ^ q[1] ^ q[0]};\n end\n end\nendmodule\n", "module top_module(\n input clk,\n input reset,\n output reg [31:0] q);\n\nalways @(posedge clk) begin\n if (reset) begin\n q <= 32'h1;\n end else begin\n q <= {q[30:0], q[31] ^ q[21] ^ q[1] ^ q[0]};\n end\nend\nendmodule\n", "module top_module(\n input clk,\n input reset,\n output reg [31:0] q\n);\n\n always @(posedge clk) begin\n if (reset) begin\n q <= 32'h1;\n end else begin\n q <= {q[30:0], q[31] ^ q[21] ^ q[1] ^ q[0]};\n end\n end\nendmodule\n", "module top_module(\n input clk,\n input reset,\n output reg [31:0] q);\n\n always @(posedge clk) begin\n if (reset) begin\n q <= 32'h1;\n end else begin\n q <= {q[30:0], q[31] ^ q[21] ^ q[1] ^ q[0]};\n end\n end\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput reset,\n\toutput reg [31:0] q);\n\n\talways @(posedge clk) begin\n\t\tif (reset) begin\n\t\t\tq <= 32'h1;\n\t\tend else begin\n\t\t\tq <= {q[30:0], (q[31] ^ q[21] ^ q[1])}; // Galois LFSR logic\n\t\tend\n\tend\nendmodule\n", "module top_module(\n input clk
{"task_id": "circuit3", "llmgen_RTL": ["module top_module (\n\tinput a, \n\tinput b, \n\tinput c, \n\tinput d,\n\toutput q\n);\n\tassign q = (b & d) | (b & c) | (a & b & ~d);\nendmodule\n", "module top_module (\n input a, \n input b, \n input c, \n input d,\n output q\n);\n assign q = (b & d) | (a & b & c);\nendmodule\n", "module top_module (\n\tinput a, \n\tinput b, \n\tinput c, \n\tinput d,\n\toutput q\n);\n assign q = (~a & ~b & d) | (~a & b & c) | (a & ~b & ~d) | (a & b & c);\nendmodule\n", "module top_module (\n\tinput a, \n\tinput b, \n\tinput c, \n\tinput d,\n\toutput q\n);\n\tassign q = (b & d) | (b & c) | (a & b & ~d) | (~a & b & c & d);\nendmodule\n", "module top_module (\n input a, \n input b, \n input c, \n input d,\n output q\n);\n assign q = (~a & ~b & d) | (~a & b & c & d) | (a & b & ~c & ~d) | (a & b & c & d);\nendmodule\n", "module top_module (\n\tinput a, \n\tinput b, \n\tinput c, \n\tinput d,\n\toutput q\n);\n\tassign q = (b & d) | (b & c) | (a & b) | (a & c & d);\nendmodule\n", "module top_module (\n input a, \n input b, \n input c, \n input d,\n output q\n);\n assign q = (b & d) | (b & c) | (a & d) | (a & b & c);\nendmodule\n", "module top_module (\n input a, \n input b, \n input c, \n input d,\n output q\n);\n assign q = (b & d) | (a & b & c);\nendmodule\n", "module top_module (\n input a, \n input b, \n input c, \n input d,\n output q\n);\n assign q = (b & d) | (a & b & c);\nendmodule\n", "module top_module (\n\tinput a, \n\tinput b, \n\tinput c, \n\tinput d,\n\toutput q\n);\n assign q = (b & d) | (a & c & d) | (a & b & ~c);\nendmodule\n", "module top_module (\n input a, \n input b, \n input c, \n input d,\n output q\n);\n assign q = (a & b & ~c & ~d) | (a & b & ~c & d) | (a & b & c & ~d) | (a & b & c & d) |\n (a & ~b & c & ~d) | (a & ~b & c & d) | (a & ~b & ~c & d) |\n (~a & b & d) | (a & ~b & ~c & ~d) | (a & ~b & c & d);\nendmodule\n", "module top_module (\n input a, \n input b, \n input c, \n input d,\n output q\n);\n assign q = (~a & ~b & ~c & d) | (~a & b & c & d) | (a & ~b & c & d) | (a & b & ~c & d) | (a & b & c & ~d) | (a & b & c & d);\nendmodule\n", "module top_module (\n input a, \n input b, \n input c, \n input d,\n output q\n);\n assign q = (b & d) | (b & c) | (a & b & c) | (a & b & d);\nendmodule\n", "module top_module (\n input a, \n input b, \n input c, \n input d,\n output q\n);\n assign q = (b & d) | (a & b & c) | (a & b & ~d);\nendmodule\n", "module top_module (\n input a, \n input b, \n input c, \n input d,\n output q\n);\n assign q = (b & d) | (a & b & c);\nendmodule\n", "module top_module (\n input a, \n input b, \n input c, \n input d,\n output q\n);\n assign q = (a && b && c) || (a && b && d) || (a && c && d) || (b && c && d) || (b && a && !d) || (!a && !b && d);\nendmodule\n", "module top_module (\n input a, \n input b, \n input c, \n input d,\n output q\n);\n\nassign q = (b & d) | (a & b & c) | (a & b & ~d);\n\nendmodule\n", "module top_module (\n input a, \n input b, \n input c, \n input d,\n output q\n);\n assign q = (b & d) | (a & b & c) | (a & b & ~d);\nendmodule\n", "module top_module (\n input a, \n input b, \n input c, \n input d,\n output q\n);\n assign q = (b & d) | (a & c) | (b & c) | (a & d);\nendmodule\n", "module top_module (\n input a, \n input b, \n input c, \n input d,\n output q\n);\n assign q = (b & d) | (a & c & d) | (a & b & ~c) | (a & b & d);\nendmodule\n"]}
{"task_id": "7420", "llmgen_RTL": ["module top_module(\n input p1a, \n input p1b, \n input p1c, \n input p1d, \n output p1y, \n input p2a, \n input p2b, \n input p2c, \n input p2d, \n output p2y\n);\n assign p1y = ~(p1a & p1b & p1c & p1d);\n assign p2y = ~(p2a & p2b & p2c & p2d);\nendmodule\n", "module top_module(\n\tinput p1a, \n\tinput p1b, \n\tinput p1c, \n\tinput p1d, \n\toutput p1y, \n\tinput p2a, \n\tinput p2b, \n\tinput p2c, \n\tinput p2d, \n\toutput p2y\n);\n\nassign p1y = ~(p1a & p1b & p1c & p1d);\nassign p2y = ~(p2a & p2b & p2c & p2d);\n\nendmodule\n", "module top_module(\n\tinput p1a, \n\tinput p1b, \n\tinput p1c, \n\tinput p1d, \n\toutput p1y, \n\tinput p2a, \n\tinput p2b, \n\tinput p2c, \n\tinput p2d, \n\toutput p2y\n);\n\tassign p1y = ~(p1a & p1b & p1c & p1d);\n\tassign p2y = ~(p2a & p2b & p2c & p2d);\nendmodule\n", "module top_module(\n input p1a, \n input p1b, \n input p1c, \n input p1d, \n output p1y, \n input p2a, \n input p2b, \n input p2c, \n input p2d, \n output p2y\n);\n\n assign p1y = ~(p1a & p1b & p1c & p1d);\n assign p2y = ~(p2a & p2b & p2c & p2d);\n\nendmodule\n", "module top_module(\n\tinput p1a, \n\tinput p1b, \n\tinput p1c, \n\tinput p1d, \n\toutput p1y, \n\tinput p2a, \n\tinput p2b, \n\tinput p2c, \n\tinput p2d, \n\toutput p2y\n);\n\twire n1, n2;\n\n\tassign n1 = ~(p1a & p1b & p1c & p1d);\n\tassign n2 = ~(p2a & p2b & p2c & p2d);\n\tassign p1y = n1;\n\tassign p2y = n2;\nendmodule\n", "module top_module(\n input p1a, \n input p1b, \n input p1c, \n input p1d, \n output p1y, \n input p2a, \n input p2b, \n input p2c, \n input p2d, \n output p2y\n);\n\nassign p1y = ~(p1a & p1b & p1c & p1d);\nassign p2y = ~(p2a & p2b & p2c & p2d);\n\nendmodule\n", "module top_module(\n\tinput p1a, \n\tinput p1b, \n\tinput p1c, \n\tinput p1d, \n\toutput p1y, \n\tinput p2a, \n\tinput p2b, \n\tinput p2c, \n\tinput p2d, \n\toutput p2y\n);\n\tassign p1y = ~(p1a & p1b & p1c & p1d);\n\tassign p2y = ~(p2a & p2b & p2c & p2d);\nendmodule\n", "module top_module(\n input p1a, \n input p1b, \n input p1c, \n input p1d, \n output p1y, \n input p2a, \n input p2b, \n input p2c, \n input p2d, \n output p2y\n);\n assign p1y = ~(p1a & p1b & p1c & p1d);\n assign p2y = ~(p2a & p2b & p2c & p2d);\nendmodule\n", "module top_module(\n input p1a, \n input p1b, \n input p1c, \n input p1d, \n output p1y, \n input p2a, \n input p2b, \n input p2c, \n input p2d, \n output p2y\n);\n assign p1y = ~(p1a & p1b & p1c & p1d);\n assign p2y = ~(p2a & p2b & p2c & p2d);\nendmodule\n", "module top_module(\n\tinput p1a, \n\tinput p1b, \n\tinput p1c, \n\tinput p1d, \n\toutput p1y, \n\tinput p2a, \n\tinput p2b, \n\tinput p2c, \n\tinput p2d, \n\toutput p2y\n);\n\tassign p1y = ~(p1a & p1b & p1c & p1d);\n\tassign p2y = ~(p2a & p2b & p2c & p2d);\nendmodule\n", "module top_module(\n\tinput p1a, \n\tinput p1b, \n\tinput p1c, \n\tinput p1d, \n\toutput p1y, \n\tinput p2a, \n\tinput p2b, \n\tinput p2c, \n\tinput p2d, \n\toutput p2y\n);\n assign p1y = ~(p1a & p1b & p1c & p1d);\n assign p2y = ~(p2a & p2b & p2c & p2d);\nendmodule\n", "module top_module(\n\tinput p1a, \n\tinput p1b, \n\tinput p1c, \n\tinput p1d, \n\toutput p1y, \n\tinput p2a, \n\tinput p2b, \n\tinput p2c, \n\tinput p2d, \n\toutput p2y\n);\n\tassign p1y = ~(p1a & p1b & p1c & p1d);\n\tassign p2y = ~(p2a & p2b & p2c & p2d);\nendmodule\n", "module top_module(\n\tinput p1a, \n\tinput p1b, \n\tinput p1c, \n\tinput p1d, \n\toutput p1y, \n\tinput p2a, \n\tinput p2b, \n\tinput p2c, \n\tinput p2d, \n\toutput p2y\n);\n\n\tassign p1y = ~(p1a & p1b & p1c & p1d);\n\tassign p2y = ~(p2a & p2b & p2c & p2d);\n\nendmodule\n", "module top_module(\n\tinput p1a, \n\tinput p1b, \n\tinput p1c, \n\tinput p1d, \n\toutput p1y, \n\tinput p2a, \n\tinput p2b, \n\tinput p2c, \n\tinput p2d, \n\toutput p2y\n);\n\tassign p1y = ~(p1a & p1b & p1c & p1d);\n\tassign p2y = ~(p2a & p2b & p2c & p2d);\nendmodule\n", "module top_module(\n\tinput p1a, \n\tinput p1b, \n\ti
{"task_id": "popcount255", "llmgen_RTL": ["module top_module (\n\tinput [254:0] in,\n\toutput reg [7:0] out\n);\n\tinteger i;\n\talways @(*) begin\n\t\tout = 0;\n\t\tfor (i = 0; i < 255; i = i + 1) begin\n\t\t\tout = out + in[i];\n\t\tend\n\tend\nendmodule\n", "module top_module (\n\tinput [254:0] in,\n\toutput reg [7:0] out\n);\n\tinteger i;\n\talways @* begin\n\t\tout = 8'b0; // Initialize output to 0\n\t\tfor (i = 0; i < 255; i = i + 1) begin\n\t\t\tout = out + in[i]; // Count the number of 1's\n\t\tend\n\tend\nendmodule\n", "module top_module (\n\tinput [254:0] in,\n\toutput reg [7:0] out\n);\n\nalways @* begin\n out = 0; // Initialize out to 0\n for (integer i = 0; i < 255; i = i + 1) begin\n out = out + in[i]; // Count the number of '1's\n end\nend\n\nendmodule\n", "module top_module (\n input [254:0] in,\n output reg [7:0] out\n);\n integer i;\n always @(*) begin\n out = 8'b0; // Initialize output\n for (i = 0; i < 255; i = i + 1) begin\n out = out + in[i]; // Count the number of '1's\n end\n end\nendmodule\n", "module top_module (\n input [254:0] in,\n output reg [7:0] out\n);\n integer i;\n always @(*) begin\n out = 0;\n for (i = 0; i < 255; i = i + 1) begin\n out = out + in[i];\n end\n end\nendmodule\n", "module top_module (\n\tinput [254:0] in,\n\toutput reg [7:0] out\n);\n\tinteger i;\n\talways @(*) begin\n\t\tout = 0; // Initialize output\n\t\tfor (i = 0; i < 255; i = i + 1) begin\n\t\t\tout = out + in[i]; // Count the number of '1's\n\t\tend\n\tend\nendmodule\n", "module top_module (\n\tinput [254:0] in,\n\toutput reg [7:0] out\n);\n\tinteger i;\n\talways @* begin\n\t\tout = 8'b0;\n\t\tfor (i = 0; i < 255; i = i + 1) begin\n\t\t\tout = out + in[i];\n\t\tend\n\tend\nendmodule\n", "module top_module (\n input [254:0] in,\n output reg [7:0] out\n);\n integer i;\n \n always @* begin\n out = 8'b0; // Initialize output to 0\n for (i = 0; i < 255; i = i + 1) begin\n out = out + in[i]; // Count the number of 1's\n end\n end\nendmodule\n", "module top_module (\n input [254:0] in,\n output reg [7:0] out\n);\n\n integer i;\n\n always @(*) begin\n out = 8'b0; // Initialize the output to 0\n for (i = 0; i < 255; i = i + 1) begin\n out = out + in[i]; // Count the number of 1's\n end\n end\n\nendmodule\n", "module top_module (\n input [254:0] in,\n output reg [7:0] out\n);\n\n integer i;\n\n always @(*) begin\n out = 0; // Initialize output\n for (i = 0; i < 255; i = i + 1) begin\n out = out + in[i]; // Count the number of '1's\n end\n end\n\nendmodule\n", "module top_module (\n\tinput [254:0] in,\n\toutput reg [7:0] out\n);\n\tinteger i;\n\talways @(*) begin\n\t\tout = 0;\n\t\tfor (i = 0; i < 255; i = i + 1) begin\n\t\t\tout = out + in[i];\n\t\tend\n\tend\nendmodule\n", "module top_module (\n\tinput [254:0] in,\n\toutput reg [7:0] out\n);\n\tinteger i;\n\n\talways @* begin\n\t\tout = 8'b0;\n\t\tfor (i = 0; i < 255; i = i + 1) begin\n\t\t\tout = out + in[i];\n\t\tend\n\tend\nendmodule\n", "module top_module (\n\tinput [254:0] in,\n\toutput reg [7:0] out\n);\n\n\tinteger i;\n\talways @* begin\n\t\tout = 8'b0;\n\t\tfor (i = 0; i < 255; i = i + 1) begin\n\t\t\tout = out + in[i];\n\t\tend\n\tend\n\nendmodule\n", "module top_module (\n\tinput [254:0] in,\n\toutput reg [7:0] out\n);\n integer i;\n always @(*) begin\n out = 0;\n for (i = 0; i < 255; i = i + 1) begin\n out = out + in[i];\n end\n end\nendmodule\n", "module top_module (\n input [254:0] in,\n output reg [7:0] out\n);\n integer i;\n always @(*) begin\n out = 8'b0;\n for (i = 0; i < 255; i = i + 1) begin\n out = out + in[i];\n end\n end\nendmodule\n", "module top_module (\n input [254:0] in,\n output reg [7:0] out\n);\n integer i;\n always @* begin\n out = 0;\n for (i = 0; i < 255; i = i + 1) begin\n
{"task_id": "gatesv", "llmgen_RTL": ["module top_module (\n input [3:0] in,\n output [2:0] out_both,\n output [3:1] out_any,\n output [3:0] out_different\n);\n assign out_both[2] = in[2] & in[3];\n assign out_both[1] = in[1] & in[2];\n assign out_both[0] = in[0] & in[1];\n\n assign out_any[3] = in[3] | in[2];\n assign out_any[2] = in[2] | in[1];\n assign out_any[1] = in[1] | in[0];\n\n assign out_different[3] = in[3] ^ in[0];\n assign out_different[2] = in[2] ^ in[3];\n assign out_different[1] = in[1] ^ in[2];\n assign out_different[0] = in[0] ^ in[1];\n\nendmodule\n", "module top_module (\n input [3:0] in,\n output [2:0] out_both,\n output [3:1] out_any,\n output [3:0] out_different\n);\n\nassign out_both[2] = in[2] & in[3];\nassign out_both[1] = in[1] & in[2];\nassign out_both[0] = in[0] & in[1];\n\nassign out_any[3] = in[3] | in[2];\nassign out_any[2] = in[2] | in[1];\nassign out_any[1] = in[1] | in[0];\n\nassign out_different[3] = in[3] ^ in[0];\nassign out_different[2] = in[2] ^ in[3];\nassign out_different[1] = in[1] ^ in[2];\nassign out_different[0] = in[0] ^ in[1];\n\nendmodule\n", "module top_module (\n input [3:0] in,\n output [2:0] out_both,\n output [3:1] out_any,\n output [3:0] out_different\n);\n\nassign out_both[2] = in[2] & in[3];\nassign out_both[1] = in[1] & in[2];\nassign out_both[0] = in[0] & in[1];\n\nassign out_any[3] = in[3] | in[2];\nassign out_any[2] = in[2] | in[1];\nassign out_any[1] = in[1] | in[0];\n\nassign out_different[3] = in[3] ^ in[0];\nassign out_different[2] = in[2] ^ in[3];\nassign out_different[1] = in[1] ^ in[2];\nassign out_different[0] = in[0] ^ in[1];\n\nendmodule\n", "module top_module (\n input [3:0] in,\n output [2:0] out_both,\n output [3:1] out_any,\n output [3:0] out_different\n);\n\nassign out_both[2] = in[2] & in[3];\nassign out_both[1] = in[1] & in[2];\nassign out_both[0] = in[0] & in[1];\n\nassign out_any[3] = in[3] | in[2];\nassign out_any[2] = in[2] | in[1];\nassign out_any[1] = in[1] | in[0];\n\nassign out_different[3] = in[3] ^ in[0];\nassign out_different[2] = in[2] ^ in[3];\nassign out_different[1] = in[1] ^ in[2];\nassign out_different[0] = in[0] ^ in[1];\n\nendmodule\n", "module top_module (\n input [3:0] in,\n output [2:0] out_both,\n output [3:1] out_any,\n output [3:0] out_different\n);\n\n assign out_both[2] = in[2] & in[3];\n assign out_both[1] = in[1] & in[2];\n assign out_both[0] = in[0] & in[1];\n\n assign out_any[3] = in[3] | in[2];\n assign out_any[2] = in[2] | in[1];\n assign out_any[1] = in[1] | in[0];\n\n assign out_different[3] = (in[3] != in[0]);\n assign out_different[2] = (in[2] != in[3]);\n assign out_different[1] = (in[1] != in[2]);\n assign out_different[0] = (in[0] != in[1]);\n\nendmodule\n", "module top_module (\n input [3:0] in,\n output [2:0] out_both,\n output [3:1] out_any,\n output [3:0] out_different\n);\n\nassign out_both[2] = in[2] & in[3];\nassign out_both[1] = in[1] & in[2];\nassign out_both[0] = in[0] & in[1];\n\nassign out_any[3] = in[3] | in[2];\nassign out_any[2] = in[2] | in[1];\nassign out_any[1] = in[1] | in[0];\n\nassign out_different[3] = in[3] ^ in[0];\nassign out_different[2] = in[2] ^ in[3];\nassign out_different[1] = in[1] ^ in[2];\nassign out_different[0] = in[0] ^ in[1];\n\nendmodule\n", "module top_module (\n input [3:0] in,\n output [2:0] out_both,\n output [3:1] out_any,\n output [3:0] out_different\n);\n\nassign out_both[2] = in[2] & in[3];\nassign out_both[1] = in[1] & in[2];\nassign out_both[0] = in[0] & in[1];\n\nassign out_any[3] = in[3] | in[2];\nassign out_any[2] = in[2] | in[1];\nassign out_any[1] = in[1] | in[0];\n\nassign out_different[3] = in[3] ^ in[0];\nassign out_different[2] = in[2] ^ in[3];\nassign out_different[1] = in[1] ^ in[2];\nassign out_different[0] = in[0] ^ in[1];\n\nendmodule\n", "module top_module (\n input [3:0] in,\n output [2:0] out_both,\n output [3:1] out_any,\n output [3:0] out_different\n);\n\nassign out_both[2] = in[2] && i
{"task_id": "circuit6", "llmgen_RTL": ["module top_module (\n input [2:0] a, \n output reg [15:0] q\n);\n always @* begin\n case (a)\n 3'b000: q = 16'h1232;\n 3'b001: q = 16'hAEE0;\n 3'b010: q = 16'h27D4;\n 3'b011: q = 16'h5A0E;\n 3'b100: q = 16'h2066;\n 3'b101: q = 16'h64CE;\n 3'b110: q = 16'hC526;\n 3'b111: q = 16'h2F19;\n default: q = 16'h0000;\n endcase\n end\nendmodule\n", "module top_module (\n input [2:0] a, \n output reg [15:0] q\n);\n always @(*) begin\n case (a)\n 3'd0: q = 16'h1232;\n 3'd1: q = 16'haee0;\n 3'd2: q = 16'h27d4;\n 3'd3: q = 16'h5a0e;\n 3'd4: q = 16'h2066;\n 3'd5: q = 16'h64ce;\n 3'd6: q = 16'hc526;\n 3'd7: q = 16'h2f19;\n default: q = 16'h0;\n endcase\n end\nendmodule\n", "module top_module (\n input [2:0] a, \n output reg [15:0] q\n);\n always @* begin\n case (a)\n 3'd0: q = 16'h1232;\n 3'd1: q = 16'haee0;\n 3'd2: q = 16'h27d4;\n 3'd3: q = 16'h5a0e;\n 3'd4: q = 16'h2066;\n 3'd5: q = 16'h64ce;\n 3'd6: q = 16'hc526;\n 3'd7: q = 16'h2f19;\n default: q = 16'hxxxx;\n endcase\n end\nendmodule\n", "module top_module (\n input [2:0] a, \n output reg [15:0] q\n);\n\nalways @(*) begin\n case (a)\n 3'b000: q = 16'h1232;\n 3'b001: q = 16'haee0;\n 3'b010: q = 16'h27d4;\n 3'b011: q = 16'h5a0e;\n 3'b100: q = 16'h2066;\n 3'b101: q = 16'h64ce;\n 3'b110: q = 16'hc526;\n 3'b111: q = 16'h2f19;\n default: q = 16'h0000;\n endcase\nend\n\nendmodule\n", "module top_module (\n input [2:0] a, \n output reg [15:0] q\n);\n\nalways @(*) begin\n case (a)\n 3'b000: q = 16'h1232;\n 3'b001: q = 16'hAEE0;\n 3'b010: q = 16'h27D4;\n 3'b011: q = 16'h5A0E;\n 3'b100: q = 16'h2066;\n 3'b101: q = 16'h64CE;\n 3'b110: q = 16'hC526;\n 3'b111: q = 16'h2F19;\n default: q = 16'h0000; // Default case\n endcase\nend\n\nendmodule\n", "module top_module (\n input [2:0] a, \n output reg [15:0] q\n);\n \n always @(*) begin\n case (a)\n 3'd0: q = 16'h1232;\n 3'd1: q = 16'haee0;\n 3'd2: q = 16'h27d4;\n 3'd3: q = 16'h5a0e;\n 3'd4: q = 16'h2066;\n 3'd5: q = 16'h64ce;\n 3'd6: q = 16'hc526;\n 3'd7: q = 16'h2f19;\n default: q = 16'h0000;\n endcase\n end\n\nendmodule\n", "module top_module (\n\tinput [2:0] a, \n\toutput reg [15:0] q\n);\n\talways @* begin\n\t\tcase (a)\n\t\t\t3'd0: q = 16'h1232;\n\t\t\t3'd1: q = 16'haee0;\n\t\t\t3'd2: q = 16'h27d4;\n\t\t\t3'd3: q = 16'h5a0e;\n\t\t\t3'd4: q = 16'h2066;\n\t\t\t3'd5: q = 16'h64ce;\n\t\t\t3'd6: q = 16'hc526;\n\t\t\t3'd7: q = 16'h2f19;\n\t\t\tdefault: q = 16'h0000; // Default case\n\t\tendcase\n\tend\nendmodule\n", "module top_module (\n input [2:0] a, \n output reg [15:0] q\n);\n always @* begin\n case (a)\n 3'd0: q = 16'h1232;\n 3'd1: q = 16'haee0;\n 3'd2: q = 16'h27d4;\n 3'd3: q = 16'h5a0e;\n 3'd4: q = 16'h2066;\n 3'd5: q = 16'h64ce;\n 3'd6: q = 16'hc526;\n 3'd7: q = 16'h2f19;\n default: q = 16'h0;\n endcase\n end\nendmodule\n", "module top_module (\n\tinput [2:0] a, \n\toutput reg [15:0] q\n);\n\nalways @* begin\n\tcase (a)\n\t\t3'd0: q = 16'h1232;\n\t\t3'd1: q = 16'haee0;\n\t\t3'd2: q = 16'h27d4;\n\t\t3'd3: q = 16'h5a0e;\n\t\t3'd4: q = 16'h2066;\n\t\t3'd5: q = 16'h64ce;\n\t\t3'd6: q = 16'hc526;\n\t\t3'd7: q = 16'h2f19;\n\t\tdefault: q = 16'h0000; // Default case to handle undefined inputs\n\tendcase\nend\n\nendmodule\n", "module top_module (\n\tinput [2:0] a, \n\toutput reg [15:0] q\n);\n\nalways @(*) begin\n\tcase (a)\n\t\t3'b000: q = 16'h1
{"task_id": "countslow", "llmgen_RTL": ["module top_module(\n input clk,\n input slowena,\n input reset,\n output reg [3:0] q\n);\n\nalways @(posedge clk) begin\n if (reset) begin\n q <= 4'd0;\n end else if (slowena) begin\n if (q == 4'd9) begin\n q <= 4'd0;\n end else begin\n q <= q + 1;\n end\n end\nend\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput slowena,\n\tinput reset,\n\toutput reg [3:0] q);\n\n\talways @(posedge clk) begin\n\t\tif (reset) begin\n\t\t\tq <= 4'b0000;\n\t\tend else if (slowena) begin\n\t\t\tif (q == 4'b1001) begin\n\t\t\t\tq <= 4'b0000;\n\t\t\tend else begin\n\t\t\t\tq <= q + 1;\n\t\t\tend\n\t\tend\n\tend\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput slowena,\n\tinput reset,\n\toutput reg [3:0] q);\n\n\talways @(posedge clk) begin\n\t\tif (reset) begin\n\t\t\tq <= 4'b0000;\n\t\tend else if (slowena) begin\n\t\t\tif (q < 4'b1001) begin\n\t\t\t\tq <= q + 1;\n\t\t\tend else begin\n\t\t\t\tq <= 4'b0000;\n\t\t\tend\n\t\tend\n\tend\nendmodule\n", "module top_module(\n input clk,\n input slowena,\n input reset,\n output reg [3:0] q\n);\n\n always @(posedge clk) begin\n if (reset) begin\n q <= 4'b0000;\n end else if (slowena) begin\n if (q == 4'b1001) begin\n q <= 4'b0000;\n end else begin\n q <= q + 1;\n end\n end\n end\n\nendmodule\n", "module top_module(\n input clk,\n input slowena,\n input reset,\n output reg [3:0] q\n);\n\n always @(posedge clk) begin\n if (reset) begin\n q <= 4'b0000; // Reset to 0\n end else if (slowena) begin\n if (q == 4'b1001) begin\n q <= 4'b0000; // Reset to 0 after counting to 9\n end else begin\n q <= q + 1; // Increment the counter\n end\n end\n end\n\nendmodule\n", "module top_module(\n input clk,\n input slowena,\n input reset,\n output reg [3:0] q\n);\n\nalways @(posedge clk) begin\n if (reset) begin\n q <= 4'b0000;\n end else if (slowena) begin\n if (q == 4'b1001) begin\n q <= 4'b0000;\n end else begin\n q <= q + 1;\n end\n end\nend\n\nendmodule\n", "module top_module(\n input clk,\n input slowena,\n input reset,\n output reg [3:0] q\n);\n always @(posedge clk) begin\n if (reset) begin\n q <= 4'b0000;\n end else if (slowena) begin\n if (q == 4'b1001) begin\n q <= 4'b0000;\n end else begin\n q <= q + 1;\n end\n end\n end\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput slowena,\n\tinput reset,\n\toutput reg [3:0] q);\n\nalways @(posedge clk) begin\n\tif (reset) begin\n\t\tq <= 4'b0000;\n\tend else if (slowena) begin\n\t\tif (q == 4'b1001) begin\n\t\t\tq <= 4'b0000;\n\t\tend else begin\n\t\t\tq <= q + 1;\n\t\tend\n\tend\nend\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput slowena,\n\tinput reset,\n\toutput reg [3:0] q);\n\n\talways @(posedge clk) begin\n\t\tif (reset) begin\n\t\t\tq <= 4'b0000;\n\t\tend else if (slowena) begin\n\t\t\tif (q == 4'b1001) begin\n\t\t\t\tq <= 4'b0000;\n\t\t\tend else begin\n\t\t\t\tq <= q + 1;\n\t\t\tend\n\t\tend\n\tend\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput slowena,\n\tinput reset,\n\toutput reg [3:0] q);\n\n\talways @(posedge clk) begin\n\t\tif (reset) begin\n\t\t\tq <= 4'b0000;\n\t\tend else if (slowena) begin\n\t\t\tif (q == 4'b1001)\n\t\t\t\tq <= 4'b0000;\n\t\t\telse\n\t\t\t\tq <= q + 1;\n\t\tend\n\tend\nendmodule\n", "module top_module(\n input clk,\n input slowena,\n input reset,\n output reg [3:0] q);\n\n always @(posedge clk) begin\n if (reset) begin\n q <= 4'b0000;\n end else if (slowena) begin\n if (q == 4'b1001) begin\n q <= 4'b0000;\n end else begin\n q <= q + 1;\n end\n end\n end\
{"task_id": "m2014_q4f", "llmgen_RTL": ["module top_module (\n input in1,\n input in2,\n output logic out\n);\n assign out = in1 & ~in2;\nendmodule\n", "module top_module (\n\tinput in1,\n\tinput in2,\n\toutput logic out\n);\n\tassign out = in1 & ~in2;\nendmodule\n", "module top_module (\n input in1,\n input in2,\n output logic out\n);\n assign out = in1 & ~in2;\nendmodule\n", "module top_module (\n\tinput in1,\n\tinput in2,\n\toutput logic out\n);\n\tassign out = in1 & ~in2;\nendmodule\n", "module top_module (\n\tinput in1,\n\tinput in2,\n\toutput logic out\n);\n\tassign out = in1 & ~in2;\nendmodule\n", "module top_module (\n\tinput in1,\n\tinput in2,\n\toutput logic out\n);\n\tassign out = in1 & ~in2;\nendmodule\n", "module top_module (\n\tinput in1,\n\tinput in2,\n\toutput logic out\n);\n assign out = in1 & ~in2;\nendmodule\n", "module top_module (\n input in1,\n input in2,\n output logic out\n);\n assign out = in1 & ~in2;\nendmodule\n", "module top_module (\n input in1,\n input in2,\n output logic out\n);\n assign out = in1 & ~in2;\nendmodule\n", "module top_module (\n input in1,\n input in2,\n output logic out\n);\n assign out = in1 & ~in2;\nendmodule\n", "module top_module (\n input in1,\n input in2,\n output logic out\n);\n assign out = in1 & ~in2;\nendmodule\n", "module top_module (\n input in1,\n input in2,\n output logic out\n);\n assign out = in1 & ~in2;\nendmodule\n", "module top_module (\n\tinput in1,\n\tinput in2,\n\toutput logic out\n);\n assign out = in1 & ~in2;\nendmodule\n", "module top_module (\n\tinput in1,\n\tinput in2,\n\toutput logic out\n);\n\tassign out = in1 & ~in2;\nendmodule\n", "module top_module (\n\tinput in1,\n\tinput in2,\n\toutput logic out\n);\n\tassign out = in1 & ~in2;\nendmodule\n", "module top_module (\n\tinput in1,\n\tinput in2,\n\toutput logic out\n);\n\tassign out = in1 & ~in2;\nendmodule\n", "module top_module (\n\tinput in1,\n\tinput in2,\n\toutput logic out\n);\n\tassign out = in1 & ~in2;\nendmodule\n", "module top_module (\n input in1,\n input in2,\n output logic out\n);\n assign out = in1 & ~in2;\nendmodule\n", "module top_module (\n input in1,\n input in2,\n output logic out\n);\n always_comb begin\n out = in1 & ~in2;\n end\nendmodule\n", "module top_module (\n\tinput in1,\n\tinput in2,\n\toutput logic out\n);\n assign out = in1 & ~in2;\nendmodule\n"]}
{"task_id": "m2014_q4h", "llmgen_RTL": ["module top_module(\n input in,\n output out\n);\n assign out = in;\nendmodule\n", "module top_module(\n\tinput in,\n\toutput out);\n\tassign out = in;\nendmodule\n", "module top_module(\n\tinput in,\n\toutput out);\n \nassign out = in;\n\nendmodule\n", "module top_module(\n\tinput in,\n\toutput out);\n\n\tassign out = in;\n\nendmodule\n", "module top_module(\n\tinput in,\n\toutput out);\n\tassign out = in;\nendmodule\n", "module top_module(\n input in,\n output out\n);\n assign out = in;\nendmodule\n", "module top_module(\n\tinput in,\n\toutput out);\n\nassign out = in;\n\nendmodule\n", "module top_module(\n\tinput in,\n\toutput out);\n\t\n\tassign out = in;\n\nendmodule\n", "module top_module(\n\tinput in,\n\toutput out\n);\n\tassign out = in;\nendmodule\n", "module top_module(\n\tinput in,\n\toutput out);\n\tassign out = in;\nendmodule\n", "module top_module(\n\tinput in,\n\toutput out\n);\n\tassign out = in;\nendmodule\n", "module top_module(\n input in,\n output out\n);\n assign out = in;\nendmodule\n", "module top_module(\n\tinput in,\n\toutput out);\n\n\tassign out = in;\n\nendmodule\n", "module top_module(\n input in,\n output out\n);\n assign out = in;\nendmodule\n", "module top_module(\n\tinput in,\n\toutput out);\n\tassign out = in;\nendmodule\n", "module top_module(\n input in,\n output out\n);\n assign out = in;\nendmodule\n", "module top_module(\n\tinput in,\n\toutput out);\n\t\n\tassign out = in;\n\nendmodule\n", "module top_module(\n\tinput in,\n\toutput out);\n\t\n\tassign out = in;\n\nendmodule\n", "module top_module(\n\tinput in,\n\toutput out\n);\n\nassign out = in;\n\nendmodule\n", "module top_module(\n\tinput in,\n\toutput out);\n\t\n\tassign out = in;\n\nendmodule\n"]}
{"task_id": "fsm1", "llmgen_RTL": ["module top_module (\n\tinput clk,\n\tinput in,\n\tinput areset,\n\toutput out\n);\n \n typedef enum reg [1:0] {A, B} state_t;\n state_t state, next_state;\n\n always @(posedge clk or posedge areset) begin\n if (areset) \n state <= B;\n else \n state <= next_state;\n end\n \n always @(*) begin\n case (state)\n A: begin\n if (in == 0)\n next_state = B;\n else\n next_state = A;\n end\n B: begin\n if (in == 0)\n next_state = A;\n else\n next_state = B;\n end\n endcase\n end\n \n assign out = (state == A) ? 0 : 1;\n\nendmodule\n", "module top_module (\n input clk,\n input in,\n input areset,\n output out\n);\n\n typedef enum logic [1:0] {\n A = 2'b00,\n B = 2'b01\n } state_t;\n\n state_t current_state, next_state;\n\n assign out = (current_state == A) ? 1'b0 : 1'b1;\n\n always_ff @(posedge clk or posedge areset) begin\n if (areset) begin\n current_state <= B;\n end else begin\n current_state <= next_state;\n end\n end\n\n always_comb begin\n case (current_state)\n A: begin\n if (in == 0)\n next_state = B;\n else\n next_state = A;\n end\n B: begin\n if (in == 0)\n next_state = A;\n else\n next_state = B;\n end\n default: next_state = B; // Default to state B\n endcase\n end\n\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput in,\n\tinput areset,\n\toutput reg out\n);\n\n\treg state; // 0 for A, 1 for B\n\n\t// State transition logic\n\talways @(posedge clk or posedge areset) begin\n\t\tif (areset) begin\n\t\t\tstate <= 1'b1; // Reset to state B\n\t\tend else begin\n\t\t\tcase (state)\n\t\t\t\t1'b0: state <= in; // From A: 0 -> B, 1 -> A\n\t\t\t\t1'b1: state <= in; // From B: 0 -> A, 1 -> B\n\t\t\tendcase\n\t\tend\n\tend\n\n\t// Output logic\n\talways @(state) begin\n\t\tout = state; // Output is the current state\n\tend\n\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput in,\n\tinput areset,\n\toutput out\n);\n\n\ttypedef enum logic [1:0] {\n\t\tA = 0,\n\t\tB = 1\n\t} state_t;\n\n\tstate_t state, next_state;\n\n\tassign out = (state == A) ? 0 : 1;\n\n\talways_ff @(posedge clk or posedge areset) begin\n\t\tif (areset) begin\n\t\t\tstate <= B;\n\t\tend else begin\n\t\t\tstate <= next_state;\n\t\tend\n\tend\n\n\talways_comb begin\n\t\tcase (state)\n\t\t\tA: begin\n\t\t\t\tif (in == 0)\n\t\t\t\t\tnext_state = B;\n\t\t\t\telse\n\t\t\t\t\tnext_state = A;\n\t\t\tend\n\t\t\tB: begin\n\t\t\t\tif (in == 0)\n\t\t\t\t\tnext_state = A;\n\t\t\t\telse\n\t\t\t\t\tnext_state = B;\n\t\t\tend\n\t\tendcase\n\tend\n\nendmodule\n", "module top_module (\n input clk,\n input in,\n input areset,\n output out\n);\n\n typedef enum logic [1:0] {\n A = 2'b00,\n B = 2'b01\n } state_t;\n\n state_t state, next_state;\n\n assign out = (state == A) ? 1'b0 : 1'b1;\n\n always_ff @(posedge clk or posedge areset) begin\n if (areset) begin\n state <= B;\n end else begin\n state <= next_state;\n end\n end\n\n always_comb begin\n case (state)\n A: begin\n if (in == 0) \n next_state = B;\n else \n next_state = A;\n end\n B: begin\n if (in == 0) \n next_state = A;\n else \n next_state = B;\n end\n default: next_state = B;\n endcase\n end\n\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput in,\n\tinput areset,\n\toutput reg out\n);\n\n\ttypedef enum reg [1:0] {A, B} state_t;\n\tstate_t current_state, next_state;\n\n\talways @(posedge clk or posedge areset) begin\n\t\tif (areset)\n\t\t\tcurrent_state <= B;\n\t
{"task_id": "dualedge", "llmgen_RTL": ["module top_module(\n input clk,\n input d,\n output reg q\n);\n\nalways @(posedge clk) begin\n q <= d;\nend\n\nalways @(negedge clk) begin\n q <= d;\nend\n\nendmodule\n", "module top_module(\n input clk,\n input d,\n output reg q\n);\n \n reg d_latch;\n\n always @(posedge clk) begin\n d_latch <= d;\n end\n \n always @(posedge clk) begin\n q <= d_latch;\n end\n\nendmodule\n", "module top_module(\n input clk,\n input d,\n output reg q);\n\n reg d_latch;\n\n always @(posedge clk) begin\n d_latch <= d;\n end\n\n always @(negedge clk) begin\n q <= d_latch;\n end\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput d,\n\toutput reg q);\n\nalways @(posedge clk) begin\n\tq <= d;\nend\n\nalways @(negedge clk) begin\n\tq <= d;\nend\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput d,\n\toutput reg q);\n\n\treg d_ff1, d_ff2;\n\n\talways @(posedge clk) begin\n\t\td_ff1 <= d;\n\t\tq <= d_ff2; \n\tend\n\n\talways @(negedge clk) begin\n\t\td_ff2 <= d_ff1;\n\tend\n\nendmodule\n", "module top_module(\n input clk,\n input d,\n output reg q\n);\n\n reg d1, d2;\n\n always @(posedge clk) begin\n d1 <= d;\n q <= d1;\n end\n\n always @(negedge clk) begin\n d2 <= d;\n q <= d2;\n end\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput d,\n\toutput reg q);\n\n\treg d_ff_0, d_ff_1;\n\n\talways @(posedge clk) begin\n\t\td_ff_0 <= d;\n\t\tq <= d_ff_1;\n\tend\n\n\talways @(negedge clk) begin\n\t\td_ff_1 <= d_ff_0;\n\tend\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput d,\n\toutput reg q);\n\n\treg d1, d2;\n\n\talways @(posedge clk) begin\n\t\td1 <= d;\n\t\tq <= d1;\n\tend\n\n\talways @(negedge clk) begin\n\t\td2 <= d;\n\t\tq <= d2;\n\tend\n\nendmodule\n", "module top_module(\n input clk,\n input d,\n output reg q\n);\n \n reg d1;\n\n always @(posedge clk) begin\n d1 <= d;\n q <= d1;\n end\n\n always @(negedge clk) begin\n q <= d;\n end\n\nendmodule\n", "module top_module(\n input clk,\n input d,\n output reg q\n);\n \n reg d1;\n\n always @(posedge clk) begin\n d1 <= d;\n q <= d1;\n end\n\nendmodule\n", "module top_module(\n input clk,\n input d,\n output reg q\n);\n\nalways @(posedge clk) begin\n q <= d;\nend\n\nalways @(negedge clk) begin\n q <= d;\nend\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput d,\n\toutput reg q);\n\t\n\talways @(posedge clk) begin\n\t\tq <= d;\n\tend\n\t\n\talways @(negedge clk) begin\n\t\tq <= d;\n\tend\n\nendmodule\n", "module top_module(\n input clk,\n input d,\n output reg q\n);\n \n reg d1, d2;\n\n always @(posedge clk) begin\n d1 <= d; // Capture data on the rising edge\n end\n\n always @(negedge clk) begin\n d2 <= d; // Capture data on the falling edge\n end\n\n always @(posedge clk or negedge clk) begin\n q <= d1 | d2; // Update q with the OR of d1 and d2\n end\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput d,\n\toutput reg q);\n\nreg d_ff;\n\nalways @(posedge clk) begin\n d_ff <= d;\nend\n\nalways @(negedge clk) begin\n q <= d_ff;\nend\n\nalways @(posedge clk or negedge clk) begin\n q <= d_ff;\nend\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput d,\n\toutput reg q);\n\nreg d_dly;\n\nalways @(posedge clk) begin\n d_dly <= d; // Capture the input on the rising edge\nend\n\nalways @(posedge clk) begin\n q <= d_dly; // Update output on the next rising edge\nend\n\nalways @(negedge clk) begin\n q <= d; // Update output on the falling edge\nend\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput d,\n\toutput reg q);\n\t\n\treg d_reg;\n\n\talways @(posedge clk) begin\n\t\td_reg <= d; // Sample input on rising edge\n\tend\n\n\talways @(posedge clk) begin\n\t\tq <= d_reg; // Update output on rising edge\n\tend\n\n\talways @(negedge clk) begin\n\t\tq <= d; // Update output on falling edge
{"task_id": "xnorgate", "llmgen_RTL": ["module top_module(\n\tinput a, \n\tinput b,\n\toutput out\n);\n\tassign out = ~(a ^ b);\nendmodule\n", "module top_module(\n input a, \n input b,\n output out\n);\n assign out = ~(a ^ b);\nendmodule\n", "module top_module(\n\tinput a, \n\tinput b,\n\toutput out\n);\n\tassign out = ~(a ^ b);\nendmodule\n", "module top_module(\n input a, \n input b,\n output out\n);\n assign out = ~(a ^ b);\nendmodule\n", "module top_module(\n\tinput a, \n\tinput b,\n\toutput out\n);\n\tassign out = ~(a ^ b);\nendmodule\n", "module top_module(\n input a, \n input b,\n output out\n);\n assign out = ~(a ^ b);\nendmodule\n", "module top_module(\n\tinput a, \n\tinput b,\n\toutput out\n);\n assign out = ~(a ^ b);\nendmodule\n", "module top_module(\n\tinput a, \n\tinput b,\n\toutput out\n);\n\tassign out = ~(a ^ b);\nendmodule\n", "module top_module(\n\tinput a, \n\tinput b,\n\toutput out\n);\n\tassign out = ~(a ^ b);\nendmodule\n", "module top_module(\n\tinput a, \n\tinput b,\n\toutput out\n);\n\tassign out = ~(a ^ b);\nendmodule\n", "module top_module(\n\tinput a, \n\tinput b,\n\toutput out\n);\n\tassign out = ~(a ^ b);\nendmodule\n", "module top_module(\n input a, \n input b,\n output out\n);\n assign out = ~(a ^ b);\nendmodule\n", "module top_module(\n\tinput a, \n\tinput b,\n\toutput out\n);\n\tassign out = ~(a ^ b);\nendmodule\n", "module top_module(\n\tinput a, \n\tinput b,\n\toutput out\n);\n\nassign out = ~(a ^ b);\n\nendmodule\n", "module top_module(\n\tinput a, \n\tinput b,\n\toutput out\n);\n\tassign out = ~(a ^ b);\nendmodule\n", "module top_module(\n\tinput a, \n\tinput b,\n\toutput out\n);\n\tassign out = ~(a ^ b);\nendmodule\n", "module top_module(\n\tinput a, \n\tinput b,\n\toutput out\n);\n\tassign out = ~(a ^ b);\nendmodule\n", "module top_module(\n\tinput a, \n\tinput b,\n\toutput out\n);\n\tassign out = ~(a ^ b);\nendmodule\n", "module top_module(\n\tinput a, \n\tinput b,\n\toutput out\n);\n\tassign out = ~(a ^ b);\nendmodule\n", "module top_module(\n\tinput a, \n\tinput b,\n\toutput out\n);\n\tassign out = ~(a ^ b);\nendmodule\n"]}
{"task_id": "mt2015_q4", "llmgen_RTL": ["module top_module(\n input x,\n input y,\n output z\n);\n\nwire a1_out, a2_out, b1_out, b2_out;\nwire or_out, and_out;\n\n// Module A implementation\nassign a1_out = (x ^ y) & x;\nassign a2_out = (x ^ y) & x;\n\n// Module B implementation (based on the provided waveform)\nassign b1_out = (x == 0 && y == 0) ? 1 :\n (x == 1 && y == 0) ? 0 :\n (x == 0 && y == 1) ? 0 :\n (x == 1 && y == 1) ? 1 : 0;\n\nassign b2_out = (x == 0 && y == 0) ? 1 :\n (x == 1 && y == 0) ? 0 :\n (x == 0 && y == 1) ? 0 :\n (x == 1 && y == 1) ? 1 : 0;\n\n// OR gate\nassign or_out = a1_out | b1_out;\n\n// AND gate\nassign and_out = a2_out & b2_out;\n\n// XOR output\nassign z = or_out ^ and_out;\n\nendmodule\n", "module top_module(\n input x,\n input y,\n output z\n);\n\n wire a1_out, a2_out, b1_out, b2_out;\n wire or_out, and_out;\n\n // Module A implementation\n assign a1_out = (x ^ y) & x;\n assign a2_out = (x ^ y) & x;\n\n // Module B implementation based on the given behavior\n assign b1_out = (x == 0 && y == 0) ? 1 :\n (x == 1 && y == 0) ? 0 :\n (x == 0 && y == 1) ? 0 :\n (x == 1 && y == 1) ? 1 :\n 1; // default case\n\n assign b2_out = (x == 0 && y == 0) ? 1 :\n (x == 1 && y == 0) ? 0 :\n (x == 0 && y == 1) ? 0 :\n (x == 1 && y == 1) ? 1 :\n 1; // default case\n\n // OR and AND gates\n assign or_out = a1_out | b1_out;\n assign and_out = a2_out & b2_out;\n\n // Final output\n assign z = or_out ^ and_out;\n\nendmodule\n", "module top_module(\n input x,\n input y,\n output z\n);\n \n wire a1_out, a2_out, b1_out, b2_out;\n wire or_out, and_out;\n\n // Module A\n assign a1_out = (x ^ y) & x;\n assign a2_out = (x ^ y) & x;\n\n // Module B\n assign b1_out = (x & ~y) | (~x & y);\n assign b2_out = (x & ~y) | (~x & y);\n\n // OR gate for A1 and B1\n assign or_out = a1_out | b1_out;\n\n // AND gate for A2 and B2\n assign and_out = a2_out & b2_out;\n\n // Final XOR gate\n assign z = or_out ^ and_out;\n\nendmodule\n", "module top_module(\n input x,\n input y,\n output z\n);\n \n wire a1_out, a2_out, b1_out, b2_out;\n wire or_out, and_out;\n\n // Module A implementation\n assign a1_out = (x ^ y) & x; // A1\n assign a2_out = (x ^ y) & x; // A2\n\n // Module B implementation\n assign b1_out = (x == 0 && y == 0) ? 1 : \n (x == 1 && y == 0) ? 0 : \n (x == 0 && y == 1) ? 0 : \n (x == 1 && y == 1) ? 1 : 1; // B1\n\n assign b2_out = (x == 0 && y == 0) ? 1 : \n (x == 1 && y == 0) ? 0 : \n (x == 0 && y == 1) ? 0 : \n (x == 1 && y == 1) ? 1 : 1; // B2\n\n // OR gate\n assign or_out = a1_out | b1_out;\n\n // AND gate\n assign and_out = a2_out & b2_out;\n\n // XOR gate\n assign z = or_out ^ and_out;\n\nendmodule\n", "module top_module(\n input x,\n input y,\n output z\n);\n wire a1_out, a2_out, b1_out, b2_out;\n wire or_out, and_out;\n\n // Module A implementation\n assign a1_out = (x ^ y) & x;\n assign a2_out = (x ^ y) & x;\n\n // Module B implementation according to the waveform\n assign b1_out = (x == 0 && y == 0) ? 1 : \n (x == 1 && y == 0) ? 0 : \n (x == 0 && y == 1) ? 0 : \n (x == 1 && y == 1) ? 1 : 1;\n\n assign b2_out = (x == 0 && y == 0) ? 1 : \n (x == 1 && y == 0) ? 0 : \n (x == 0 && y == 1) ? 0 : \n (x == 1 && y == 1) ? 1 : 1;\n\n // OR and AND gates\n assign or_out = a1_out | b1_out;\n assign and_out = a2_out & b2_out;\n\n // Final output\n assign z = or_out ^ and_out;\n\nendmodule\n", "module top_module(\n input x,\n input y,\n output z\n);
{"task_id": "rotate100", "llmgen_RTL": ["module top_module(\n input clk,\n input load,\n input [1:0] ena,\n input [99:0] data,\n output reg [99:0] q);\n\n always @(posedge clk) begin\n if (load) begin\n q <= data;\n end else begin\n case (ena)\n 2'b01: q <= {q[0], q[99:1]}; // Right rotate\n 2'b10: q <= {q[98:0], q[99]}; // Left rotate\n default: q <= q; // No rotation\n endcase\n end\n end\nendmodule\n", "module top_module(\n input clk,\n input load,\n input [1:0] ena,\n input [99:0] data,\n output reg [99:0] q\n);\n \n always @(posedge clk) begin\n if (load) begin\n q <= data;\n end else begin\n case (ena)\n 2'b01: q <= {q[0], q[99:1]}; // Rotate right by one bit\n 2'b10: q <= {q[98:0], q[99]}; // Rotate left by one bit\n default: q <= q; // Do not rotate\n endcase\n end\n end\n\nendmodule\n", "module top_module(\n input clk,\n input load,\n input [1:0] ena,\n input [99:0] data,\n output reg [99:0] q\n);\n\n always @(posedge clk) begin\n if (load) begin\n q <= data;\n end else begin\n case (ena)\n 2'b01: q <= {q[0], q[99:1]}; // Rotate right by one bit\n 2'b10: q <= {q[98:0], q[99]}; // Rotate left by one bit\n default: q <= q; // No rotation\n endcase\n end\n end\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput load,\n\tinput [1:0] ena,\n\tinput [99:0] data,\n\toutput reg [99:0] q);\n \n\talways @(posedge clk) begin\n\t\tif (load) begin\n\t\t\tq <= data;\n\t\tend else begin\n\t\t\tcase (ena)\n\t\t\t\t2'b01: q <= {q[0], q[99:1]}; // Rotate right\n\t\t\t\t2'b10: q <= {q[98:0], q[99]}; // Rotate left\n\t\t\t\tdefault: q <= q; // No rotation\n\t\t\tendcase\n\t\tend\n\tend\nendmodule\n", "module top_module(\n input clk,\n input load,\n input [1:0] ena,\n input [99:0] data,\n output reg [99:0] q\n);\n\nalways @(posedge clk) begin\n if (load) begin\n q <= data;\n end else begin\n case (ena)\n 2'b01: q <= {q[0], q[99:1]}; // Rotate right\n 2'b10: q <= {q[98:0], q[99]}; // Rotate left\n default: q <= q; // Do not rotate\n endcase\n end\nend\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput load,\n\tinput [1:0] ena,\n\tinput [99:0] data,\n\toutput reg [99:0] q);\n\n\talways @(posedge clk) begin\n\t\tif (load) begin\n\t\t\tq <= data;\n\t\tend else begin\n\t\t\tcase (ena)\n\t\t\t\t2'b01: q <= {q[0], q[99:1]}; // Rotate right\n\t\t\t\t2'b10: q <= {q[98:0], q[99]}; // Rotate left\n\t\t\t\t2'b00: q <= q; // No rotation\n\t\t\t\t2'b11: q <= q; // No rotation\n\t\t\tendcase\n\t\tend\n\tend\nendmodule\n", "module top_module(\n input clk,\n input load,\n input [1:0] ena,\n input [99:0] data,\n output reg [99:0] q\n);\n \n always @(posedge clk) begin\n if (load) begin\n q <= data;\n end else begin\n case (ena)\n 2'b01: q <= {q[0], q[99:1]}; // Rotate right\n 2'b10: q <= {q[98:0], q[99]}; // Rotate left\n default: q <= q; // No rotation\n endcase\n end\n end\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput load,\n\tinput [1:0] ena,\n\tinput [99:0] data,\n\toutput reg [99:0] q);\n\n\talways @(posedge clk) begin\n\t\tif (load) begin\n\t\t\tq <= data;\n\t\tend else begin\n\t\t\tcase (ena)\n\t\t\t\t2'b01: q <= {q[0], q[99:1]}; // Rotate right\n\t\t\t\t2'b10: q <= {q[98:0], q[99]}; // Rotate left\n\t\t\t\tdefault: q <= q; // No rotation\n\t\t\tendcase\n\t\tend\n\tend\nendmodule\n", "module top_module(\n input clk,\n input load,\n input [1:0] ena,\n input [99:0] data,\n output reg [99:0] q\n);\n always @(posedge clk) begin\n if (load) begin\n q <= data;\n end else begin\n case (ena)\n 2'b01
{"task_id": "review2015_count1k", "llmgen_RTL": ["module top_module(\n\tinput clk,\n\tinput reset,\n\toutput reg [9:0] q);\n\n\talways @(posedge clk) begin\n\t\tif (reset) begin\n\t\t\tq <= 10'b0000000000;\n\t\tend else if (q < 10'd999) begin\n\t\t\tq <= q + 1;\n\t\tend else begin\n\t\t\tq <= 10'b0000000000;\n\t\tend\n\tend\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput reset,\n\toutput reg [9:0] q);\n\n\talways @(posedge clk) begin\n\t\tif (reset) begin\n\t\t\tq <= 10'd0;\n\t\tend else if (q < 10'd999) begin\n\t\t\tq <= q + 10'd1;\n\t\tend else begin\n\t\t\tq <= 10'd0;\n\t\tend\n\tend\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput reset,\n\toutput reg [9:0] q);\n\n\talways @(posedge clk) begin\n\t\tif (reset) begin\n\t\t\tq <= 10'd0;\n\t\tend else if (q == 10'd999) begin\n\t\t\tq <= 10'd0;\n\t\tend else begin\n\t\t\tq <= q + 10'd1;\n\t\tend\n\tend\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput reset,\n\toutput reg [9:0] q);\n\nalways @(posedge clk) begin\n\tif (reset) begin\n\t\tq <= 0;\n\tend else if (q < 999) begin\n\t\tq <= q + 1;\n\tend else begin\n\t\tq <= 0;\n\tend\nend\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput reset,\n\toutput reg [9:0] q);\n\n\talways @(posedge clk) begin\n\t\tif (reset) begin\n\t\t\tq <= 10'b0;\n\t\tend else if (q < 10'd999) begin\n\t\t\tq <= q + 1;\n\t\tend else begin\n\t\t\tq <= 10'b0;\n\t\tend\n\tend\nendmodule\n", "module top_module(\n input clk,\n input reset,\n output reg [9:0] q\n);\n\n always @(posedge clk) begin\n if (reset) begin\n q <= 10'd0;\n end else if (q < 10'd999) begin\n q <= q + 1;\n end else begin\n q <= 10'd0;\n end\n end\n\nendmodule\n", "module top_module(\n input clk,\n input reset,\n output reg [9:0] q\n);\n\n always @(posedge clk) begin\n if (reset) begin\n q <= 10'b0;\n end else if (q < 10'd999) begin\n q <= q + 1;\n end else begin\n q <= 10'b0;\n end\n end\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput reset,\n\toutput reg [9:0] q);\n\nalways @(posedge clk) begin\n\tif (reset) begin\n\t\tq <= 10'b0;\n\tend else begin\n\t\tif (q == 10'd999) begin\n\t\t\tq <= 10'b0;\n\t\tend else begin\n\t\t\tq <= q + 10'b1;\n\t\tend\n\tend\nend\n\nendmodule\n", "module top_module(\n input clk,\n input reset,\n output reg [9:0] q);\n\n always @(posedge clk) begin\n if (reset) begin\n q <= 10'b0;\n end else if (q == 10'd999) begin\n q <= 10'b0;\n end else begin\n q <= q + 1;\n end\n end\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput reset,\n\toutput reg [9:0] q);\n\n\talways @(posedge clk) begin\n\t\tif (reset) begin\n\t\t\tq <= 10'd0;\n\t\tend else if (q < 10'd999) begin\n\t\t\tq <= q + 1;\n\t\tend else begin\n\t\t\tq <= 10'd0;\n\t\tend\n\tend\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput reset,\n\toutput reg [9:0] q);\n\n\talways @(posedge clk) begin\n\t\tif (reset) begin\n\t\t\tq <= 10'b0;\n\t\tend else if (q < 10'd999) begin\n\t\t\tq <= q + 1;\n\t\tend else begin\n\t\t\tq <= 10'b0;\n\t\tend\n\tend\nendmodule\n", "module top_module(\n input clk,\n input reset,\n output reg [9:0] q\n);\n always @(posedge clk) begin\n if (reset) begin\n q <= 0;\n end else if (q < 999) begin\n q <= q + 1;\n end else begin\n q <= 0;\n end\n end\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput reset,\n\toutput reg [9:0] q);\n\nalways @(posedge clk) begin\n\tif (reset) begin\n\t\tq <= 0;\n\tend else if (q < 999) begin\n\t\tq <= q + 1;\n\tend else begin\n\t\tq <= 0;\n\tend\nend\n\nendmodule\n", "module top_module(\n input clk,\n input reset,\n output reg [9:0] q);\n\n always @(posedge clk) begin\n if (reset) begin\n q <= 10'd0;\n end else begin\n if (q == 10'd999) begin\n q <= 10'd0;\n end else begin\n q <= q + 10'd1;\n
{"task_id": "notgate", "llmgen_RTL": ["module top_module(\n input in,\n output out\n);\n assign out = ~in;\nendmodule\n", "module top_module(\n\tinput in,\n\toutput out\n);\n\tassign out = ~in;\nendmodule\n", "module top_module(\n\tinput in,\n\toutput out\n);\n\tassign out = ~in;\nendmodule\n", "module top_module(\n\tinput in,\n\toutput out\n);\n\tassign out = ~in;\nendmodule\n", "module top_module(\n input in,\n output out\n);\n assign out = ~in;\nendmodule\n", "module top_module(\n\tinput in,\n\toutput out\n);\n\tassign out = ~in;\nendmodule\n", "module top_module(\n\tinput in,\n\toutput out\n);\n\tassign out = ~in;\nendmodule\n", "module top_module(\n\tinput in,\n\toutput out\n);\n\tassign out = ~in;\nendmodule\n", "module top_module(\n\tinput in,\n\toutput out\n);\n\tassign out = ~in;\nendmodule\n", "module top_module(\n\tinput in,\n\toutput out\n);\n\tassign out = ~in;\nendmodule\n", "module top_module(\n\tinput in,\n\toutput out\n);\n\tassign out = ~in;\nendmodule\n", "module top_module(\n\tinput in,\n\toutput out\n);\n\tassign out = ~in;\nendmodule\n", "module top_module(\n\tinput in,\n\toutput out\n);\n\tassign out = ~in;\nendmodule\n", "module top_module(\n\tinput in,\n\toutput out\n);\n\tassign out = ~in;\nendmodule\n", "module top_module(\n\tinput in,\n\toutput out\n);\n\tassign out = ~in;\nendmodule\n", "module top_module(\n\tinput in,\n\toutput out\n);\n\tassign out = ~in;\nendmodule\n", "module top_module(\n\tinput in,\n\toutput out\n);\n\tassign out = ~in;\nendmodule\n", "module top_module(\n\tinput in,\n\toutput out\n);\n\tassign out = ~in;\nendmodule\n", "module top_module(\n\tinput in,\n\toutput out\n);\n\tassign out = ~in;\nendmodule\n", "module top_module(\n\tinput in,\n\toutput out\n);\n\tassign out = ~in;\nendmodule\n"]}
{"task_id": "fsm_onehot", "llmgen_RTL": ["module top_module (\n input in,\n input [9:0] state,\n output reg [9:0] next_state,\n output reg out1,\n output reg out2\n);\n\nalways @(*) begin\n next_state = 10'b0000000000;\n out1 = 0;\n out2 = 0;\n\n case (state)\n 10'b0000000001: begin // S0\n if (in) next_state = 10'b0000000010; // S1\n else next_state = 10'b0000000001; // S0\n end\n \n 10'b0000000010: begin // S1\n if (in) next_state = 10'b0000000100; // S2\n else next_state = 10'b0000000001; // S0\n end\n \n 10'b0000000100: begin // S2\n if (in) next_state = 10'b0000001000; // S3\n else next_state = 10'b0000000001; // S0\n end\n \n 10'b0000001000: begin // S3\n if (in) next_state = 10'b0000010000; // S4\n else next_state = 10'b0000000001; // S0\n end\n \n 10'b0000010000: begin // S4\n if (in) next_state = 10'b0000100000; // S5\n else next_state = 10'b0000000001; // S0\n end\n \n 10'b0000100000: begin // S5\n if (in) next_state = 10'b0001000000; // S6\n else next_state = 10'b0010000000; // S8\n end\n \n 10'b0001000000: begin // S6\n if (in) next_state = 10'b0010000000; // S7\n else next_state = 10'b0000100000; // S5\n end\n \n 10'b0010000000: begin // S7\n out2 = 1; // S7 outputs (0, 1)\n if (in) next_state = 10'b0010000000; // S7\n else next_state = 10'b0000000001; // S0\n end\n \n 10'b0010000000: begin // S8\n out1 = 1; // S8 outputs (1, 0)\n if (in) next_state = 10'b0000000010; // S1\n else next_state = 10'b0000000001; // S0\n end\n \n 10'b0010000000: begin // S9\n out1 = 1; // S9 outputs (1, 1)\n if (in) next_state = 10'b0000000010; // S1\n else next_state = 10'b0000000001; // S0\n end\n \n default: next_state = 10'b0000000000; // Default case\n endcase\nend\n\nendmodule\n", "module top_module (\n input in,\n input [9:0] state,\n output [9:0] next_state,\n output out1,\n output out2\n);\n\nassign next_state = \n (state[0] && !in) ? 10'b0000000001 : // S0 --0--> S0\n (state[0] && in) ? 10'b0000000010 : // S0 --1--> S1\n (state[1] && !in) ? 10'b0000000001 : // S1 --0--> S0\n (state[1] && in) ? 10'b0000000100 : // S1 --1--> S2\n (state[2] && !in) ? 10'b0000000001 : // S2 --0--> S0\n (state[2] && in) ? 10'b0000001000 : // S2 --1--> S3\n (state[3] && !in) ? 10'b0000000001 : // S3 --0--> S0\n (state[3] && in) ? 10'b0000010000 : // S3 --1--> S4\n (state[4] && !in) ? 10'b0000000001 : // S4 --0--> S0\n (state[4] && in) ? 10'b0000100000 : // S4 --1--> S5\n (state[5] && !in) ? 10'b0001000000 : // S5 --0--> S8\n (state[5] && in) ? 10'b0010000000 : // S5 --1--> S6\n (state[6] && !in) ? 10'b0100000000 : // S6 --0--> S9\n (state[6] && in) ? 10'b0000000001 : // S6 --1--> S7\n (state[7] && !in) ? 10'b0000000001 : // S7 --0--> S0\n (state[7] && in) ? 10'b0000000100 : // S7 --1--> S7\n (state[8] && !in) ? 10'b0000000001 : // S8 --0--> S0\n (state[8] && in) ? 10'b0000000010 : // S8 --1--> S1\n (state[9] && !in) ? 10'b0000000001 : // S9 --0--> S0\n (state[9] && in) ? 10'b0000000010 : // S9 --1--> S1\n 10'b0000000000; // Default case (should not occur)\n\nassign out1 = (state[7] && !in) || (state[8] && !in) || (state[9] && in);\nassign out2 = (state[7] && in) || (state[8] && in) || (state[9] && !in);\n\nendmodule\n", "module top_module (\n\tinput in,\n\tinput [9:0] state,\n\toutput [9:0] next_state,\n\toutput out1,\n\toutput out2\n);\n\n\tassign next_state = \n\t\t(state[0] & ~in) ? 10'b0000000001 : // S0 --0--> S0\n\t\t(state[0] & in) ? 10'b0000000010 : // S0 --1--> S1\n\t\t(state[1] & ~in) ? 10'b0000000001 : // S1 --0--> S0\n\t\t(state[1] & in) ? 10'b000
{"task_id": "ece241_2013_q7", "llmgen_RTL": ["module top_module (\n input clk,\n input j,\n input k,\n output reg Q\n);\n always @(posedge clk) begin\n case ({j, k})\n 2'b00: Q <= Q; // Qold\n 2'b01: Q <= 1'b0; // 0\n 2'b10: Q <= 1'b1; // 1\n 2'b11: Q <= ~Q; // ~Qold\n endcase\n end\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput j,\n\tinput k,\n\toutput reg Q\n);\n\nalways @(posedge clk) begin\n\tif (j == 0 && k == 0) \n\t\tQ <= Q; // Qold\n\telse if (j == 0 && k == 1) \n\t\tQ <= 0; // Reset\n\telse if (j == 1 && k == 0) \n\t\tQ <= 1; // Set\n\telse if (j == 1 && k == 1) \n\t\tQ <= ~Q; // Toggle\nend\n\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput j,\n\tinput k,\n\toutput reg Q\n);\n\nalways @(posedge clk) begin\n\tif (j == 0 && k == 0) begin\n\t\tQ <= Q; // Qold\n\tend else if (j == 0 && k == 1) begin\n\t\tQ <= 0; // Reset\n\tend else if (j == 1 && k == 0) begin\n\t\tQ <= 1; // Set\n\tend else if (j == 1 && k == 1) begin\n\t\tQ <= ~Q; // Toggle\n\tend\nend\n\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput j,\n\tinput k,\n\toutput reg Q\n);\n \n\treg Qold;\n\n\talways @(posedge clk) begin\n\t\tif (j == 0 && k == 0) \n\t\t\tQ <= Q; // Qold\n\t\telse if (j == 0 && k == 1) \n\t\t\tQ <= 0; \n\t\telse if (j == 1 && k == 0) \n\t\t\tQ <= 1; \n\t\telse if (j == 1 && k == 1) \n\t\t\tQ <= ~Q; \n\tend\n\nendmodule\n", "module top_module (\n input clk,\n input j,\n input k,\n output reg Q\n);\n always @(posedge clk) begin\n case ({j, k})\n 2'b00: Q <= Q; // Qold\n 2'b01: Q <= 1'b0; // Reset\n 2'b10: Q <= 1'b1; // Set\n 2'b11: Q <= ~Q; // Toggle\n endcase\n end\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput j,\n\tinput k,\n\toutput reg Q\n);\n \n\talways @(posedge clk) begin\n\t\tcase ({j, k})\n\t\t\t2'b00: Q <= Q; // Qold\n\t\t\t2'b01: Q <= 0; // Reset\n\t\t\t2'b10: Q <= 1; // Set\n\t\t\t2'b11: Q <= ~Q; // Toggle\n\t\tendcase\n\tend\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput j,\n\tinput k,\n\toutput reg Q\n);\n\nalways @(posedge clk) begin\n\tif (j == 0 && k == 0) \n\t\tQ <= Q; // Qold\n\telse if (j == 0 && k == 1) \n\t\tQ <= 0; \n\telse if (j == 1 && k == 0) \n\t\tQ <= 1; \n\telse if (j == 1 && k == 1) \n\t\tQ <= ~Q; \nend\n\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput j,\n\tinput k,\n\toutput reg Q\n);\n\t\n\talways @(posedge clk) begin\n\t\tcase ({j, k})\n\t\t\t2'b00: Q <= Q; // Qold\n\t\t\t2'b01: Q <= 0; // Reset\n\t\t\t2'b10: Q <= 1; // Set\n\t\t\t2'b11: Q <= ~Q; // Toggle\n\t\tendcase\n\tend\n\t\nendmodule\n", "module top_module (\n input clk,\n input j,\n input k,\n output reg Q\n);\n \n always @(posedge clk) begin\n case ({j, k})\n 2'b00: Q <= Q; // Qold\n 2'b01: Q <= 1'b0; // 0\n 2'b10: Q <= 1'b1; // 1\n 2'b11: Q <= ~Q; // ~Qold\n endcase\n end\n \nendmodule\n", "module top_module (\n\tinput clk,\n\tinput j,\n\tinput k,\n\toutput reg Q\n);\n\n\talways @(posedge clk) begin\n\t\tcase ({j, k})\n\t\t\t2'b00: Q <= Q; // Qold\n\t\t\t2'b01: Q <= 1'b0; // Reset\n\t\t\t2'b10: Q <= 1'b1; // Set\n\t\t\t2'b11: Q <= ~Q; // Toggle\n\t\tendcase\n\tend\n\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput j,\n\tinput k,\n\toutput reg Q\n);\n\n\talways @(posedge clk) begin\n\t\tcase ({j, k})\n\t\t\t2'b00: Q <= Q; // Qold\n\t\t\t2'b01: Q <= 0; // Reset\n\t\t\t2'b10: Q <= 1; // Set\n\t\t\t2'b11: Q <= ~Q; // Toggle\n\t\tendcase\n\tend\n\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput j,\n\tinput k,\n\toutput reg Q\n);\n\talways @(posedge clk) begin\n\t\tif (j == 0 && k == 0) begin\n\t\t\tQ <= Q; // Qold\n\t\tend else if (j == 0 && k == 1) begin\n\t\t\tQ <= 0; // Reset\n\t\tend else if (j == 1 && k == 0) begin\n\t\
{"task_id": "popcount3", "llmgen_RTL": ["module top_module (\n\tinput [2:0] in,\n\toutput [1:0] out\n);\n\nassign out = in[0] + in[1] + in[2];\n\nendmodule\n", "module top_module (\n\tinput [2:0] in,\n\toutput [1:0] out\n);\n\tassign out = in[0] + in[1] + in[2];\nendmodule\n", "module top_module (\n\tinput [2:0] in,\n\toutput [1:0] out\n);\n\tassign out = in[0] + in[1] + in[2];\nendmodule\n", "module top_module (\n\tinput [2:0] in,\n\toutput [1:0] out\n);\n\tassign out = in[0] + in[1] + in[2];\nendmodule\n", "module top_module (\n\tinput [2:0] in,\n\toutput [1:0] out\n);\n\n\tassign out = in[0] + in[1] + in[2];\n\nendmodule\n", "module top_module (\n\tinput [2:0] in,\n\toutput [1:0] out\n);\n\tassign out = in[0] + in[1] + in[2];\nendmodule\n", "module top_module (\n input [2:0] in,\n output [1:0] out\n);\n assign out = in[0] + in[1] + in[2];\nendmodule\n", "module top_module (\n\tinput [2:0] in,\n\toutput [1:0] out\n);\n\nassign out = in[0] + in[1] + in[2];\n\nendmodule\n", "module top_module (\n\tinput [2:0] in,\n\toutput [1:0] out\n);\n\n\tassign out = in[0] + in[1] + in[2];\n\nendmodule\n", "module top_module (\n\tinput [2:0] in,\n\toutput [1:0] out\n);\n assign out = in[0] + in[1] + in[2];\nendmodule\n", "module top_module (\n\tinput [2:0] in,\n\toutput [1:0] out\n);\n\tassign out = in[0] + in[1] + in[2];\nendmodule\n", "module top_module (\n\tinput [2:0] in,\n\toutput [1:0] out\n);\n\tassign out = in[0] + in[1] + in[2];\nendmodule\n", "module top_module (\n\tinput [2:0] in,\n\toutput [1:0] out\n);\n\tassign out = in[0] + in[1] + in[2];\nendmodule\n", "module top_module (\n\tinput [2:0] in,\n\toutput [1:0] out\n);\n\tassign out = in[0] + in[1] + in[2];\nendmodule\n", "module top_module (\n\tinput [2:0] in,\n\toutput [1:0] out\n);\n\tassign out = in[0] + in[1] + in[2];\nendmodule\n", "module top_module (\n\tinput [2:0] in,\n\toutput [1:0] out\n);\n assign out = in[0] + in[1] + in[2];\nendmodule\n", "module top_module (\n\tinput [2:0] in,\n\toutput [1:0] out\n);\n\tassign out = in[0] + in[1] + in[2];\nendmodule\n", "module top_module (\n input [2:0] in,\n output [1:0] out\n);\n\n assign out = in[0] + in[1] + in[2];\n\nendmodule\n", "module top_module (\n input [2:0] in,\n output [1:0] out\n);\n assign out = in[0] + in[1] + in[2];\nendmodule\n", "module top_module (\n\tinput [2:0] in,\n\toutput [1:0] out\n);\n assign out = in[0] + in[1] + in[2];\nendmodule\n"]}
{"task_id": "vector5", "llmgen_RTL": ["module top_module (\n input a,\n input b,\n input c,\n input d,\n input e,\n output [24:0] out\n);\n\nassign out[24] = ~(a ^ a);\nassign out[23] = ~(a ^ b);\nassign out[22] = ~(a ^ c);\nassign out[21] = ~(a ^ d);\nassign out[20] = ~(a ^ e);\nassign out[19] = ~(b ^ a);\nassign out[18] = ~(b ^ b);\nassign out[17] = ~(b ^ c);\nassign out[16] = ~(b ^ d);\nassign out[15] = ~(b ^ e);\nassign out[14] = ~(c ^ a);\nassign out[13] = ~(c ^ b);\nassign out[12] = ~(c ^ c);\nassign out[11] = ~(c ^ d);\nassign out[10] = ~(c ^ e);\nassign out[9] = ~(d ^ a);\nassign out[8] = ~(d ^ b);\nassign out[7] = ~(d ^ c);\nassign out[6] = ~(d ^ d);\nassign out[5] = ~(d ^ e);\nassign out[4] = ~(e ^ a);\nassign out[3] = ~(e ^ b);\nassign out[2] = ~(e ^ c);\nassign out[1] = ~(e ^ d);\nassign out[0] = ~(e ^ e);\n\nendmodule\n", "module top_module (\n\tinput a,\n\tinput b,\n\tinput c,\n\tinput d,\n\tinput e,\n\toutput [24:0] out\n);\n\nassign out[24] = ~(a ^ a);\nassign out[23] = ~(a ^ b);\nassign out[22] = ~(a ^ c);\nassign out[21] = ~(a ^ d);\nassign out[20] = ~(a ^ e);\nassign out[19] = ~(b ^ a);\nassign out[18] = ~(b ^ b);\nassign out[17] = ~(b ^ c);\nassign out[16] = ~(b ^ d);\nassign out[15] = ~(b ^ e);\nassign out[14] = ~(c ^ a);\nassign out[13] = ~(c ^ b);\nassign out[12] = ~(c ^ c);\nassign out[11] = ~(c ^ d);\nassign out[10] = ~(c ^ e);\nassign out[9] = ~(d ^ a);\nassign out[8] = ~(d ^ b);\nassign out[7] = ~(d ^ c);\nassign out[6] = ~(d ^ d);\nassign out[5] = ~(d ^ e);\nassign out[4] = ~(e ^ a);\nassign out[3] = ~(e ^ b);\nassign out[2] = ~(e ^ c);\nassign out[1] = ~(e ^ d);\nassign out[0] = ~(e ^ e);\n\nendmodule\n", "module top_module (\n input a,\n input b,\n input c,\n input d,\n input e,\n output [24:0] out\n);\n\nassign out[24] = ~(a ^ a);\nassign out[23] = ~(a ^ b);\nassign out[22] = ~(a ^ c);\nassign out[21] = ~(a ^ d);\nassign out[20] = ~(a ^ e);\nassign out[19] = ~(b ^ a);\nassign out[18] = ~(b ^ b);\nassign out[17] = ~(b ^ c);\nassign out[16] = ~(b ^ d);\nassign out[15] = ~(b ^ e);\nassign out[14] = ~(c ^ a);\nassign out[13] = ~(c ^ b);\nassign out[12] = ~(c ^ c);\nassign out[11] = ~(c ^ d);\nassign out[10] = ~(c ^ e);\nassign out[ 9] = ~(d ^ a);\nassign out[ 8] = ~(d ^ b);\nassign out[ 7] = ~(d ^ c);\nassign out[ 6] = ~(d ^ d);\nassign out[ 5] = ~(d ^ e);\nassign out[ 4] = ~(e ^ a);\nassign out[ 3] = ~(e ^ b);\nassign out[ 2] = ~(e ^ c);\nassign out[ 1] = ~(e ^ d);\nassign out[ 0] = ~(e ^ e);\n\nendmodule\n", "module top_module (\n input a,\n input b,\n input c,\n input d,\n input e,\n output [24:0] out\n);\n assign out[24] = ~(a ^ a);\n assign out[23] = ~(a ^ b);\n assign out[22] = ~(a ^ c);\n assign out[21] = ~(a ^ d);\n assign out[20] = ~(a ^ e);\n \n assign out[19] = ~(b ^ a);\n assign out[18] = ~(b ^ b);\n assign out[17] = ~(b ^ c);\n assign out[16] = ~(b ^ d);\n assign out[15] = ~(b ^ e);\n \n assign out[14] = ~(c ^ a);\n assign out[13] = ~(c ^ b);\n assign out[12] = ~(c ^ c);\n assign out[11] = ~(c ^ d);\n assign out[10] = ~(c ^ e);\n \n assign out[9] = ~(d ^ a);\n assign out[8] = ~(d ^ b);\n assign out[7] = ~(d ^ c);\n assign out[6] = ~(d ^ d);\n assign out[5] = ~(d ^ e);\n \n assign out[4] = ~(e ^ a);\n assign out[3] = ~(e ^ b);\n assign out[2] = ~(e ^ c);\n assign out[1] = ~(e ^ d);\n assign out[0] = ~(e ^ e);\nendmodule\n", "module top_module (\n\tinput a,\n\tinput b,\n\tinput c,\n\tinput d,\n\tinput e,\n\toutput [24:0] out\n);\n\nassign out[24] = ~(a ^ a);\nassign out[23] = ~(a ^ b);\nassign out[22] = ~(a ^ c);\nassign out[21] = ~(a ^ d);\nassign out[20] = ~(a ^ e);\nassign out[19] = ~(b ^ a);\nassign out[18] = ~(b ^ b);\nassign out[17] = ~(b ^ c);\nassign out[16] = ~(b ^ d);\nassign out[15] = ~(b ^ e);\nassign out[14] = ~(c ^ a);\nassign out[13] = ~(c ^ b);\nassign out[12] = ~(c ^ c);\nassign out[11] = ~(c ^ d);\nassign out[10] = ~(c ^ e);\nassign out[9] = ~(d ^ a);\nassign out[8] = ~(d ^ b);\nassign out[7] =
{"task_id": "lemmings1", "llmgen_RTL": ["module top_module (\n\tinput clk,\n\tinput areset,\n\tinput bump_left,\n\tinput bump_right,\n\toutput reg walk_left,\n\toutput reg walk_right\n);\n\n\ttypedef enum reg [1:0] {WALK_LEFT, WALK_RIGHT} state_t;\n\tstate_t current_state, next_state;\n\n\talways @(posedge clk or posedge areset) begin\n\t\tif (areset) \n\t\t\tcurrent_state <= WALK_LEFT;\n\t\telse \n\t\t\tcurrent_state <= next_state;\n\tend\n\n\talways @(*) begin\n\t\tcase (current_state)\n\t\t\tWALK_LEFT: begin\n\t\t\t\twalk_left = 1;\n\t\t\t\twalk_right = 0;\n\t\t\t\tif (bump_right) \n\t\t\t\t\tnext_state = WALK_LEFT;\n\t\t\t\telse \n\t\t\t\t\tnext_state = WALK_RIGHT;\n\t\t\tend\n\t\t\tWALK_RIGHT: begin\n\t\t\t\twalk_left = 0;\n\t\t\t\twalk_right = 1;\n\t\t\t\tif (bump_left) \n\t\t\t\t\tnext_state = WALK_RIGHT;\n\t\t\t\telse \n\t\t\t\t\tnext_state = WALK_LEFT;\n\t\t\tend\n\t\t\tdefault: begin\n\t\t\t\tnext_state = WALK_LEFT;\n\t\t\t\twalk_left = 1;\n\t\t\t\twalk_right = 0;\n\t\t\tend\n\t\tendcase\n\tend\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput areset,\n\tinput bump_left,\n\tinput bump_right,\n\toutput reg walk_left,\n\toutput reg walk_right\n);\n\n\ttypedef enum logic [1:0] {WALK_LEFT, WALK_RIGHT} state_t;\n\tstate_t state, next_state;\n\n\talways_ff @(posedge clk or posedge areset) begin\n\t\tif (areset)\n\t\t\tstate <= WALK_LEFT;\n\t\telse\n\t\t\tstate <= next_state;\n\tend\n\n\talways_ff @(state or bump_left or bump_right) begin\n\t\tcase (state)\n\t\t\tWALK_LEFT: begin\n\t\t\t\twalk_left = 1;\n\t\t\t\twalk_right = 0;\n\t\t\t\tif (bump_right)\n\t\t\t\t\tnext_state = WALK_RIGHT;\n\t\t\t\telse\n\t\t\t\t\tnext_state = WALK_LEFT;\n\t\t\tend\n\t\t\tWALK_RIGHT: begin\n\t\t\t\twalk_left = 0;\n\t\t\t\twalk_right = 1;\n\t\t\t\tif (bump_left)\n\t\t\t\t\tnext_state = WALK_LEFT;\n\t\t\t\telse\n\t\t\t\t\tnext_state = WALK_RIGHT;\n\t\t\tend\n\t\tendcase\n\tend\n\nendmodule\n", "module top_module (\n input clk,\n input areset,\n input bump_left,\n input bump_right,\n output reg walk_left,\n output reg walk_right\n);\n\n typedef enum logic [1:0] {\n S_WALK_LEFT = 2'b00,\n S_WALK_RIGHT = 2'b01\n } state_t;\n\n state_t current_state, next_state;\n\n always_ff @(posedge clk or posedge areset) begin\n if (areset) begin\n current_state <= S_WALK_LEFT;\n end else begin\n current_state <= next_state;\n end\n end\n\n always_comb begin\n case (current_state)\n S_WALK_LEFT: begin\n walk_left = 1;\n walk_right = 0;\n if (bump_right)\n next_state = S_WALK_RIGHT;\n else\n next_state = S_WALK_LEFT;\n end\n \n S_WALK_RIGHT: begin\n walk_left = 0;\n walk_right = 1;\n if (bump_left)\n next_state = S_WALK_LEFT;\n else\n next_state = S_WALK_RIGHT;\n end\n \n default: begin\n walk_left = 0;\n walk_right = 0;\n next_state = S_WALK_LEFT;\n end\n endcase\n end\n\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput areset,\n\tinput bump_left,\n\tinput bump_right,\n\toutput reg walk_left,\n\toutput reg walk_right\n);\n\n\ttypedef enum reg [1:0] {WALK_LEFT, WALK_RIGHT} state_t;\n\tstate_t current_state, next_state;\n\n\talways @(posedge clk or posedge areset) begin\n\t\tif (areset) \n\t\t\tcurrent_state <= WALK_LEFT;\n\t\telse \n\t\t\tcurrent_state <= next_state;\n\tend\n\n\talways @(*) begin\n\t\tcase (current_state)\n\t\t\tWALK_LEFT: begin\n\t\t\t\twalk_left = 1;\n\t\t\t\twalk_right = 0;\n\t\t\t\tif (bump_right) \n\t\t\t\t\tnext_state = WALK_LEFT;\n\t\t\t\telse if (bump_left) \n\t\t\t\t\tnext_state = WALK_RIGHT;\n\t\t\t\telse \n\t\t\t\t\tnext_state = WALK_LEFT;\n\t\t\tend\n\t\t\t\n\t\t\tWALK_RIGHT: begin\n\t\t\t\twalk_left = 0;\n\t\t\t\twalk_right = 1;\n\t\t\t\tif (bump_left) \n\t\t\t\t\tnext_state =
{"task_id": "circuit1", "llmgen_RTL": ["module top_module (\n input a, \n input b, \n output q\n);\n assign q = (a & b);\nendmodule\n", "module top_module (\n input a, \n input b, \n output q\n);\n assign q = (a & b) ? 1 : 0;\nendmodule\n", "module top_module (\n input a, \n input b, \n output q\n);\n assign q = (a && b);\nendmodule\n", "module top_module (\n\tinput a, \n\tinput b, \n\toutput q\n);\n\tassign q = (a & b);\nendmodule\n", "module top_module (\n input a, \n input b, \n output q\n);\n assign q = (a & b);\nendmodule\n", "module top_module (\n input a, \n input b, \n output q\n);\n\nassign q = (a & b);\n\nendmodule\n", "module top_module (\n input a, \n input b, \n output q\n);\n assign q = (a & b);\nendmodule\n", "module top_module (\n input a, \n input b, \n output q\n);\n assign q = (a & b);\nendmodule\n", "module top_module (\n input a, \n input b, \n output q\n);\n assign q = (a & b);\nendmodule\n", "module top_module (\n input a, \n input b, \n output q\n);\n assign q = (a & b);\nendmodule\n", "module top_module (\n input a, \n input b, \n output q\n);\n assign q = (a & b);\nendmodule\n", "module top_module (\n\tinput a, \n\tinput b, \n\toutput q\n);\n\nassign q = (a & b);\n\nendmodule\n", "module top_module (\n input a, \n input b, \n output q\n);\n assign q = (a & b);\nendmodule\n", "module top_module (\n input a, \n input b, \n output q\n);\n assign q = (a & b);\nendmodule\n", "module top_module (\n input a, \n input b, \n output q\n);\n assign q = (a & b);\nendmodule\n", "module top_module (\n\tinput a, \n\tinput b, \n\toutput q\n);\n\tassign q = (a & b);\nendmodule\n", "module top_module (\n input a, \n input b, \n output q\n);\n assign q = (a & b);\nendmodule\n", "module top_module (\n\tinput a, \n\tinput b, \n\toutput q\n);\n\tassign q = (a & b);\nendmodule\n", "module top_module (\n\tinput a, \n\tinput b, \n\toutput q\n);\n\tassign q = (a & b);\nendmodule\n", "module top_module (\n\tinput a, \n\tinput b, \n\toutput q\n);\n\tassign q = (a & b);\nendmodule\n"]}
{"task_id": "7458", "llmgen_RTL": ["module top_module(\n input p1a, \n input p1b, \n input p1c, \n input p1d,\n input p1e,\n input p1f,\n output p1y, \n input p2a, \n input p2b, \n input p2c, \n input p2d, \n output p2y\n);\n\n wire and1_out, and2_out, and3_out, and4_out;\n\n // Two 3-input AND gates\n assign and1_out = p1a & p1b & p1c;\n assign and2_out = p1d & p1e & p1f;\n\n // Output p1y is the OR of the two 3-input AND gates\n assign p1y = and1_out | and2_out;\n\n // Two 2-input AND gates\n assign and3_out = p2a & p2b;\n assign and4_out = p2c & p2d;\n\n // Output p2y is the OR of the two 2-input AND gates\n assign p2y = and3_out | and4_out;\n\nendmodule\n", "module top_module(\n\tinput p1a, \n\tinput p1b, \n\tinput p1c, \n\tinput p1d,\n\tinput p1e,\n\tinput p1f,\n\toutput p1y, \n\tinput p2a, \n\tinput p2b, \n\tinput p2c, \n\tinput p2d, \n\toutput p2y\n);\n\n\twire and1_out, and2_out, and3_out, and4_out;\n\n\tassign and1_out = p1a & p1b & p1c; // 3-input AND\n\tassign and2_out = p1d & p1e & p1f; // 3-input AND\n\tassign p1y = and1_out | and2_out; // OR of two ANDs\n\n\tassign and3_out = p2a & p2b; // 2-input AND\n\tassign and4_out = p2c & p2d; // 2-input AND\n\tassign p2y = and3_out | and4_out; // OR of two ANDs\n\nendmodule\n", "module top_module(\n\tinput p1a, \n\tinput p1b, \n\tinput p1c, \n\tinput p1d,\n\tinput p1e,\n\tinput p1f,\n\toutput p1y, \n\tinput p2a, \n\tinput p2b, \n\tinput p2c, \n\tinput p2d, \n\toutput p2y\n);\n\twire and1_out, and2_out, and3_out, and4_out;\n\n\tassign and1_out = p1a & p1b & p1c;\n\tassign and2_out = p1d & p1e & p1f;\n\tassign p1y = and1_out | and2_out;\n\n\tassign and3_out = p2a & p2b;\n\tassign and4_out = p2c & p2d;\n\tassign p2y = and3_out | and4_out;\n\nendmodule\n", "module top_module(\n\tinput p1a, \n\tinput p1b, \n\tinput p1c, \n\tinput p1d,\n\tinput p1e,\n\tinput p1f,\n\toutput p1y, \n\tinput p2a, \n\tinput p2b, \n\tinput p2c, \n\tinput p2d, \n\toutput p2y\n);\n\n\twire and1, and2, and3, and4;\n\n\tassign and1 = p1a & p1b & p1c; // First 3-input AND gate\n\tassign and2 = p1d & p1e & p1f; // Second 3-input AND gate\n\tassign p1y = and1 | and2; // OR of the two AND gates\n\n\tassign and3 = p2a & p2b; // First 2-input AND gate\n\tassign and4 = p2c & p2d; // Second 2-input AND gate\n\tassign p2y = and3 | and4; // OR of the two AND gates\n\nendmodule\n", "module top_module(\n\tinput p1a, \n\tinput p1b, \n\tinput p1c, \n\tinput p1d,\n\tinput p1e,\n\tinput p1f,\n\toutput p1y, \n\tinput p2a, \n\tinput p2b, \n\tinput p2c, \n\tinput p2d, \n\toutput p2y\n);\n wire and1_out, and2_out, and3_out, and4_out;\n\n assign and1_out = p1a & p1b & p1c; // First 3-input AND gate\n assign and2_out = p1d & p1e & p1f; // Second 3-input AND gate\n assign p1y = and1_out | and2_out; // OR gate for p1y\n\n assign and3_out = p2a & p2b; // First 2-input AND gate\n assign and4_out = p2c & p2d; // Second 2-input AND gate\n assign p2y = and3_out | and4_out; // OR gate for p2y\nendmodule\n", "module top_module(\n\tinput p1a, \n\tinput p1b, \n\tinput p1c, \n\tinput p1d,\n\tinput p1e,\n\tinput p1f,\n\toutput p1y, \n\tinput p2a, \n\tinput p2b, \n\tinput p2c, \n\tinput p2d, \n\toutput p2y\n);\n\n\twire and1_out, and2_out, and3_out, and4_out;\n\n\tassign and1_out = p1a & p1b & p1c;\n\tassign and2_out = p1d & p1e & p1f;\n\tassign p1y = and1_out | and2_out;\n\n\tassign and3_out = p2a & p2b;\n\tassign and4_out = p2c & p2d;\n\tassign p2y = and3_out | and4_out;\n\nendmodule\n", "module top_module(\n input p1a, \n input p1b, \n input p1c, \n input p1d,\n input p1e,\n input p1f,\n output p1y, \n input p2a, \n input p2b, \n input p2c, \n input p2d, \n output p2y\n);\n \n wire and1_out, and2_out, and3_out, and4_out;\n\n assign and1_out = p1a & p1b & p1c; // First 3-input AND gate\n assign and2_out = p1d & p1e & p1f; // Second 3-input AND gate\n assign p1y = and1_out | and2_out; // Output of the OR gate for p1y\n\n assign and3_out = p2a & p2b; // Fir
{"task_id": "2014_q3c", "llmgen_RTL": ["module top_module (\n input clk,\n input x,\n input [2:0] y,\n output reg Y0,\n output reg z\n);\n\nreg [2:0] next_state;\n\nalways @(posedge clk) begin\n case (y)\n 3'b000: next_state <= (x == 0) ? 3'b000 : 3'b001;\n 3'b001: next_state <= (x == 0) ? 3'b001 : 3'b100;\n 3'b010: next_state <= (x == 0) ? 3'b010 : 3'b001;\n 3'b011: next_state <= (x == 0) ? 3'b001 : 3'b010;\n 3'b100: next_state <= (x == 0) ? 3'b011 : 3'b100;\n default: next_state <= 3'b000;\n endcase\nend\n\nalways @(posedge clk) begin\n y <= next_state;\n case (y)\n 3'b000, 3'b001, 3'b010: z <= 0;\n 3'b011, 3'b100: z <= 1;\n default: z <= 0;\n endcase\n Y0 <= y[0];\nend\n\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput x,\n\tinput [2:0] y,\n\toutput reg Y0,\n\toutput reg z\n);\n\treg [2:0] next_state;\n\n\talways @(posedge clk) begin\n\t\ty <= next_state;\n\tend\n\t\n\talways @(*) begin\n\t\tcase (y)\n\t\t\t3'b000: next_state = (x) ? 3'b001 : 3'b000;\n\t\t\t3'b001: next_state = (x) ? 3'b100 : 3'b001;\n\t\t\t3'b010: next_state = (x) ? 3'b001 : 3'b010;\n\t\t\t3'b011: next_state = (x) ? 3'b010 : 3'b001;\n\t\t\t3'b100: next_state = (x) ? 3'b100 : 3'b011;\n\t\t\tdefault: next_state = 3'b000;\n\t\tendcase\n\tend\n\t\n\talways @(*) begin\n\t\tcase (y)\n\t\t\t3'b000: z = 0;\n\t\t\t3'b001: z = 0;\n\t\t\t3'b010: z = 0;\n\t\t\t3'b011: z = 1;\n\t\t\t3'b100: z = 1;\n\t\t\tdefault: z = 0;\n\t\tendcase\n\tend\n\t\n\talways @(*) begin\n\t\tY0 = y[0];\n\tend\nendmodule\n", "module top_module (\n input clk,\n input x,\n input [2:0] y,\n output reg Y0,\n output reg z\n);\n reg [2:0] next_state;\n\n always @(*) begin\n case (y)\n 3'b000: next_state = (x == 0) ? 3'b000 : 3'b001;\n 3'b001: next_state = (x == 0) ? 3'b001 : 3'b100;\n 3'b010: next_state = (x == 0) ? 3'b010 : 3'b001;\n 3'b011: next_state = (x == 0) ? 3'b001 : 3'b010;\n 3'b100: next_state = (x == 0) ? 3'b011 : 3'b100;\n default: next_state = 3'b000;\n endcase\n end\n\n always @(posedge clk) begin\n y <= next_state;\n case (y)\n 3'b000, 3'b001, 3'b010: z <= 0;\n 3'b011, 3'b100: z <= 1;\n default: z <= 0;\n endcase\n end\n\n always @(posedge clk) begin\n Y0 <= y[0];\n end\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput x,\n\tinput [2:0] y,\n\toutput reg Y0,\n\toutput reg z\n);\n\nreg [2:0] next_state;\n\nalways @(*) begin\n\tcase (y)\n\t\t3'b000: next_state = (x == 0) ? 3'b000 : 3'b001;\n\t\t3'b001: next_state = (x == 0) ? 3'b001 : 3'b100;\n\t\t3'b010: next_state = (x == 0) ? 3'b010 : 3'b001;\n\t\t3'b011: next_state = (x == 0) ? 3'b001 : 3'b010;\n\t\t3'b100: next_state = (x == 0) ? 3'b011 : 3'b100;\n\t\tdefault: next_state = 3'b000;\n\tendcase\nend\n\nalways @(posedge clk) begin\n\ty <= next_state;\n\tY0 <= next_state[0];\n\tz <= (y == 3'b011 || y == 3'b100) ? 1'b1 : 1'b0;\nend\n\nendmodule\n", "module top_module (\n input clk,\n input x,\n input [2:0] y,\n output reg Y0,\n output reg z\n);\n \n reg [2:0] state;\n reg [2:0] next_state;\n\n always @(posedge clk) begin\n state <= next_state;\n end\n\n always @(*) begin\n case (state)\n 3'b000: begin\n next_state = (x == 0) ? 3'b000 : 3'b001;\n z = 0;\n end\n 3'b001: begin\n next_state = (x == 0) ? 3'b001 : 3'b100;\n z = 0;\n end\n 3'b010: begin\n next_state = (x == 0) ? 3'b010 : 3'b001;\n z = 0;\n end\n 3'b011: begin\n next_state = (x == 0) ? 3'b001 : 3'b010;\n z = 1;\n end\n 3'b100: begin\n next_state = (x == 0) ? 3'b011 : 3'b100;\n z = 1;\n end\n default: begin\n next_state = 3'b000;\n z = 0;\n
{"task_id": "m2014_q4e", "llmgen_RTL": ["module top_module (\n\tinput in1,\n\tinput in2,\n\toutput logic out\n);\n assign out = ~(in1 | in2);\nendmodule\n", "module top_module (\n\tinput in1,\n\tinput in2,\n\toutput logic out\n);\n assign out = ~(in1 | in2);\nendmodule\n", "module top_module (\n\tinput in1,\n\tinput in2,\n\toutput logic out\n);\n assign out = ~(in1 | in2);\nendmodule\n", "module top_module (\n\tinput in1,\n\tinput in2,\n\toutput logic out\n);\n assign out = ~(in1 | in2);\nendmodule\n", "module top_module (\n\tinput in1,\n\tinput in2,\n\toutput logic out\n);\n\tassign out = ~(in1 | in2);\nendmodule\n", "module top_module (\n input in1,\n input in2,\n output logic out\n);\n assign out = ~(in1 | in2);\nendmodule\n", "module top_module (\n input in1,\n input in2,\n output logic out\n);\n assign out = ~(in1 | in2);\nendmodule\n", "module top_module (\n\tinput in1,\n\tinput in2,\n\toutput logic out\n);\n\tassign out = ~(in1 | in2);\nendmodule\n", "module top_module (\n\tinput in1,\n\tinput in2,\n\toutput logic out\n);\n\tassign out = ~(in1 | in2);\nendmodule\n", "module top_module (\n\tinput in1,\n\tinput in2,\n\toutput logic out\n);\n\tassign out = ~(in1 | in2);\nendmodule\n", "module top_module (\n\tinput in1,\n\tinput in2,\n\toutput logic out\n);\n\talways @* begin\n\t\tout = ~(in1 | in2);\n\tend\nendmodule\n", "module top_module (\n input in1,\n input in2,\n output logic out\n);\n assign out = ~(in1 | in2);\nendmodule\n", "module top_module (\n\tinput in1,\n\tinput in2,\n\toutput logic out\n);\n\tassign out = ~(in1 | in2);\nendmodule\n", "module top_module (\n\tinput in1,\n\tinput in2,\n\toutput logic out\n);\n\tassign out = ~(in1 | in2);\nendmodule\n", "module top_module (\n input in1,\n input in2,\n output logic out\n);\n assign out = ~(in1 | in2);\nendmodule\n", "module top_module (\n\tinput in1,\n\tinput in2,\n\toutput logic out\n);\n\talways @(*) begin\n\t\tout = ~(in1 | in2);\n\tend\nendmodule\n", "module top_module (\n\tinput in1,\n\tinput in2,\n\toutput logic out\n);\n\tassign out = ~(in1 | in2);\nendmodule\n", "module top_module (\n\tinput in1,\n\tinput in2,\n\toutput logic out\n);\n assign out = ~(in1 | in2);\nendmodule\n", "module top_module (\n\tinput in1,\n\tinput in2,\n\toutput logic out\n);\n\tassign out = ~(in1 | in2);\nendmodule\n", "module top_module (\n\tinput in1,\n\tinput in2,\n\toutput logic out\n);\n\tassign out = ~(in1 | in2);\nendmodule\n"]}
{"task_id": "wire4", "llmgen_RTL": ["module top_module (\n\tinput a,\n\tinput b,\n\tinput c,\n\toutput w,\n\toutput x,\n\toutput y,\n\toutput z\n);\n\tassign w = a;\n\tassign x = b;\n\tassign y = b;\n\tassign z = c;\nendmodule\n", "module top_module (\n input a,\n input b,\n input c,\n output w,\n output x,\n output y,\n output z\n);\n\n assign w = a;\n assign x = b;\n assign y = b;\n assign z = c;\n\nendmodule\n", "module top_module (\n\tinput a,\n\tinput b,\n\tinput c,\n\toutput w,\n\toutput x,\n\toutput y,\n\toutput z\n);\n\tassign w = a;\n\tassign x = b;\n\tassign y = b;\n\tassign z = c;\nendmodule\n", "module top_module (\n input a,\n input b,\n input c,\n output w,\n output x,\n output y,\n output z\n);\n\nassign w = a;\nassign x = b;\nassign y = b;\nassign z = c;\n\nendmodule\n", "module top_module (\n\tinput a,\n\tinput b,\n\tinput c,\n\toutput w,\n\toutput x,\n\toutput y,\n\toutput z\n);\n\nassign w = a;\nassign x = b;\nassign y = b;\nassign z = c;\n\nendmodule\n", "module top_module (\n input a,\n input b,\n input c,\n output w,\n output x,\n output y,\n output z\n);\n\nassign w = a;\nassign x = b;\nassign y = b;\nassign z = c;\n\nendmodule\n", "module top_module (\n\tinput a,\n\tinput b,\n\tinput c,\n\toutput w,\n\toutput x,\n\toutput y,\n\toutput z\n);\n\nassign w = a;\nassign x = b;\nassign y = b;\nassign z = c;\n\nendmodule\n", "module top_module (\n input a,\n input b,\n input c,\n output w,\n output x,\n output y,\n output z\n);\n\nassign w = a;\nassign x = b;\nassign y = b;\nassign z = c;\n\nendmodule\n", "module top_module (\n input a,\n input b,\n input c,\n output w,\n output x,\n output y,\n output z\n);\n\nassign w = a;\nassign x = b;\nassign y = b;\nassign z = c;\n\nendmodule\n", "module top_module (\n input a,\n input b,\n input c,\n output w,\n output x,\n output y,\n output z\n);\n\nassign w = a;\nassign x = b;\nassign y = b;\nassign z = c;\n\nendmodule\n", "module top_module (\n\tinput a,\n\tinput b,\n\tinput c,\n\toutput w,\n\toutput x,\n\toutput y,\n\toutput z\n);\n\tassign w = a;\n\tassign x = b;\n\tassign y = b;\n\tassign z = c;\nendmodule\n", "module top_module (\n\tinput a,\n\tinput b,\n\tinput c,\n\toutput w,\n\toutput x,\n\toutput y,\n\toutput z\n);\n\n\tassign w = a;\n\tassign x = b;\n\tassign y = b;\n\tassign z = c;\n\nendmodule\n", "module top_module (\n\tinput a,\n\tinput b,\n\tinput c,\n\toutput w,\n\toutput x,\n\toutput y,\n\toutput z\n);\n\n\tassign w = a;\n\tassign x = b;\n\tassign y = b;\n\tassign z = c;\n\nendmodule\n", "module top_module (\n\tinput a,\n\tinput b,\n\tinput c,\n\toutput w,\n\toutput x,\n\toutput y,\n\toutput z \n);\n\tassign w = a;\n\tassign x = b;\n\tassign y = b;\n\tassign z = c;\nendmodule\n", "module top_module (\n\tinput a,\n\tinput b,\n\tinput c,\n\toutput w,\n\toutput x,\n\toutput y,\n\toutput z\n);\n\nassign w = a;\nassign x = b;\nassign y = b;\nassign z = c;\n\nendmodule\n", "module top_module (\n\tinput a,\n\tinput b,\n\tinput c,\n\toutput w,\n\toutput x,\n\toutput y,\n\toutput z\n);\n\nassign w = a;\nassign x = b;\nassign y = b;\nassign z = c;\n\nendmodule\n", "module top_module (\n\tinput a,\n\tinput b,\n\tinput c,\n\toutput w,\n\toutput x,\n\toutput y,\n\toutput z\n\t);\n\t\n\tassign w = a;\n\tassign x = b;\n\tassign y = b;\n\tassign z = c;\n\nendmodule\n", "module top_module (\n\tinput a,\n\tinput b,\n\tinput c,\n\toutput w,\n\toutput x,\n\toutput y,\n\toutput z\n);\n\nassign w = a;\nassign x = b;\nassign y = b;\nassign z = c;\n\nendmodule\n", "module top_module (\n\tinput a,\n\tinput b,\n\tinput c,\n\toutput w,\n\toutput x,\n\toutput y,\n\toutput z\n);\n\nassign w = a;\nassign x = b;\nassign y = b;\nassign z = c;\n\nendmodule\n", "module top_module (\n input a,\n input b,\n input c,\n output w,\n output x,\n output y,\n output z\n);\n assign w = a;\n assign x = b;\n assign y = b;\n assign z = c;\nendmodule\n"]}
{"task_id": "m2014_q4b", "llmgen_RTL": ["module top_module (\n\tinput clk,\n\tinput d,\n\tinput ar,\n\toutput logic q\n);\n\talways_ff @(posedge clk or posedge ar) begin\n\t\tif (ar) begin\n\t\t\tq <= 1'b0;\n\t\tend else begin\n\t\t\tq <= d;\n\t\tend\n\tend\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput d,\n\tinput ar,\n\toutput logic q\n);\n always_ff @(posedge clk or posedge ar) begin\n if (ar) begin\n q <= 0;\n end else begin\n q <= d;\n end\n end\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput d,\n\tinput ar,\n\toutput logic q\n);\n\n\talways_ff @(posedge clk or posedge ar) begin\n\t\tif (ar) begin\n\t\t\tq <= 1'b0;\n\t\tend else begin\n\t\t\tq <= d;\n\t\tend\n\tend\n\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput d,\n\tinput ar,\n\toutput logic q\n);\n\n\talways_ff @(posedge clk or posedge ar) begin\n\t\tif (ar) begin\n\t\t\tq <= 1'b0;\n\t\tend else begin\n\t\t\tq <= d;\n\t\tend\n\tend\n\nendmodule\n", "module top_module (\n input clk,\n input d,\n input ar,\n output logic q\n);\n always_ff @(posedge clk or posedge ar) begin\n if (ar) begin\n q <= 0;\n end else begin\n q <= d;\n end\n end\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput d,\n\tinput ar,\n\toutput logic q\n);\n\talways_ff @(posedge clk or posedge ar) begin\n\t\tif (ar) begin\n\t\t\tq <= 1'b0; // Asynchronous reset\n\t\tend else begin\n\t\t\tq <= d; // Data input\n\t\tend\n\tend\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput d,\n\tinput ar,\n\toutput logic q\n);\n\n\talways_ff @(posedge clk or posedge ar) begin\n\t\tif (ar)\n\t\t\tq <= 1'b0;\n\t\telse\n\t\t\tq <= d;\n\tend\n\nendmodule\n", "module top_module (\n input clk,\n input d,\n input ar,\n output logic q\n);\n always_ff @(posedge clk or posedge ar) begin\n if (ar) begin\n q <= 1'b0;\n end else begin\n q <= d;\n end\n end\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput d,\n\tinput ar,\n\toutput logic q\n);\n\talways_ff @(posedge clk or posedge ar) begin\n\t\tif (ar)\n\t\t\tq <= 1'b0;\n\t\telse\n\t\t\tq <= d;\n\tend\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput d,\n\tinput ar,\n\toutput logic q\n);\n\nalways_ff @(posedge clk or posedge ar) begin\n\tif (ar)\n\t\tq <= 1'b0;\n\telse\n\t\tq <= d;\nend\n\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput d,\n\tinput ar,\n\toutput logic q\n);\n\talways_ff @(posedge clk or posedge ar) begin\n\t\tif (ar) \n\t\t\tq <= 1'b0;\n\t\telse \n\t\t\tq <= d;\n\tend\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput d,\n\tinput ar,\n\toutput logic q\n);\n\talways_ff @(posedge clk or posedge ar) begin\n\t\tif (ar)\n\t\t\tq <= 1'b0;\n\t\telse\n\t\t\tq <= d;\n\tend\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput d,\n\tinput ar,\n\toutput logic q\n);\n\talways_ff @(posedge clk or posedge ar) begin\n\t\tif (ar) begin\n\t\t\tq <= 1'b0;\n\t\tend else begin\n\t\t\tq <= d;\n\t\tend\n\tend\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput d,\n\tinput ar,\n\toutput logic q\n);\n\talways_ff @(posedge clk or posedge ar) begin\n\t\tif (ar) \n\t\t\tq <= 1'b0;\n\t\telse \n\t\t\tq <= d;\n\tend\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput d,\n\tinput ar,\n\toutput logic q\n);\n\talways_ff @(posedge clk or posedge ar) begin\n\t\tif (ar) begin\n\t\t\tq <= 0;\n\t\tend else begin\n\t\t\tq <= d;\n\t\tend\n\tend\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput d,\n\tinput ar,\n\toutput logic q\n);\n\talways_ff @(posedge clk or posedge ar) begin\n\t\tif (ar) begin\n\t\t\tq <= 1'b0;\n\t\tend else begin\n\t\t\tq <= d;\n\t\tend\n\tend\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput d,\n\tinput ar,\n\toutput logic q\n);\n\talways_ff @(posedge clk or posedge ar) begin\n\t\tif (ar) \n\t\t\tq <= 1'b0;\n\t\telse \n\t\t\tq <= d;\n\tend\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput d,\n\tinput ar,\n\toutput logic q\n);\n\talways_ff @(posedge clk or posedge ar) begin\n\
{"task_id": "always_case", "llmgen_RTL": ["module top_module (\n\tinput [2:0] sel,\n\tinput [3:0] data0,\n\tinput [3:0] data1,\n\tinput [3:0] data2,\n\tinput [3:0] data3,\n\tinput [3:0] data4,\n\tinput [3:0] data5,\n\toutput reg [3:0] out\n);\n\talways @(*) begin\n\t\tcase (sel)\n\t\t\t3'b000: out = data0;\n\t\t\t3'b001: out = data1;\n\t\t\t3'b010: out = data2;\n\t\t\t3'b011: out = data3;\n\t\t\t3'b100: out = data4;\n\t\t\t3'b101: out = data5;\n\t\t\tdefault: out = 4'b0000;\n\t\tendcase\n\tend\nendmodule\n", "module top_module (\n input [2:0] sel,\n input [3:0] data0,\n input [3:0] data1,\n input [3:0] data2,\n input [3:0] data3,\n input [3:0] data4,\n input [3:0] data5,\n output reg [3:0] out\n);\n always @(*) begin\n case(sel)\n 3'd0: out = data0;\n 3'd1: out = data1;\n 3'd2: out = data2;\n 3'd3: out = data3;\n 3'd4: out = data4;\n 3'd5: out = data5;\n default: out = 4'b0000;\n endcase\n end\nendmodule\n", "module top_module (\n input [2:0] sel,\n input [3:0] data0,\n input [3:0] data1,\n input [3:0] data2,\n input [3:0] data3,\n input [3:0] data4,\n input [3:0] data5,\n output reg [3:0] out\n);\n\n always @(*) begin\n case (sel)\n 3'b000: out = data0;\n 3'b001: out = data1;\n 3'b010: out = data2;\n 3'b011: out = data3;\n 3'b100: out = data4;\n 3'b101: out = data5;\n default: out = 4'b0000;\n endcase\n end\n\nendmodule\n", "module top_module (\n\tinput [2:0] sel,\n\tinput [3:0] data0,\n\tinput [3:0] data1,\n\tinput [3:0] data2,\n\tinput [3:0] data3,\n\tinput [3:0] data4,\n\tinput [3:0] data5,\n\toutput reg [3:0] out\n);\n\talways @(*) begin\n\t\tcase (sel)\n\t\t\t3'b000: out = data0;\n\t\t\t3'b001: out = data1;\n\t\t\t3'b010: out = data2;\n\t\t\t3'b011: out = data3;\n\t\t\t3'b100: out = data4;\n\t\t\t3'b101: out = data5;\n\t\t\tdefault: out = 4'b0000;\n\t\tendcase\n\tend\nendmodule\n", "module top_module (\n\tinput [2:0] sel,\n\tinput [3:0] data0,\n\tinput [3:0] data1,\n\tinput [3:0] data2,\n\tinput [3:0] data3,\n\tinput [3:0] data4,\n\tinput [3:0] data5,\n\toutput reg [3:0] out\n);\n\nalways @(*) begin\n\tcase (sel)\n\t\t3'b000: out = data0;\n\t\t3'b001: out = data1;\n\t\t3'b010: out = data2;\n\t\t3'b011: out = data3;\n\t\t3'b100: out = data4;\n\t\t3'b101: out = data5;\n\t\tdefault: out = 4'b0000;\n\tendcase\nend\n\nendmodule\n", "module top_module (\n\tinput [2:0] sel,\n\tinput [3:0] data0,\n\tinput [3:0] data1,\n\tinput [3:0] data2,\n\tinput [3:0] data3,\n\tinput [3:0] data4,\n\tinput [3:0] data5,\n\toutput reg [3:0] out\n);\n\n\talways @(*) begin\n\t\tcase(sel)\n\t\t\t3'b000: out = data0;\n\t\t\t3'b001: out = data1;\n\t\t\t3'b010: out = data2;\n\t\t\t3'b011: out = data3;\n\t\t\t3'b100: out = data4;\n\t\t\t3'b101: out = data5;\n\t\t\tdefault: out = 4'b0000;\n\t\tendcase\n\tend\n\nendmodule\n", "module top_module (\n\tinput [2:0] sel,\n\tinput [3:0] data0,\n\tinput [3:0] data1,\n\tinput [3:0] data2,\n\tinput [3:0] data3,\n\tinput [3:0] data4,\n\tinput [3:0] data5,\n\toutput reg [3:0] out\n);\n\nalways @(*) begin\n case (sel)\n 3'b000: out = data0;\n 3'b001: out = data1;\n 3'b010: out = data2;\n 3'b011: out = data3;\n 3'b100: out = data4;\n 3'b101: out = data5;\n default: out = 4'b0000;\n endcase\nend\n\nendmodule\n", "module top_module (\n\tinput [2:0] sel,\n\tinput [3:0] data0,\n\tinput [3:0] data1,\n\tinput [3:0] data2,\n\tinput [3:0] data3,\n\tinput [3:0] data4,\n\tinput [3:0] data5,\n\toutput reg [3:0] out\n);\n\n\talways @(*) begin\n\t\tcase (sel)\n\t\t\t3'b000: out = data0;\n\t\t\t3'b001: out = data1;\n\t\t\t3'b010: out = data2;\n\t\t\t3'b011: out = data3;\n\t\t\t3'b100: out = data4;\n\t\t\t3'b101: out = data5;\n\t\t\tdefault: out = 4'b0000;\n\t\tendcase\n\tend\n\nendmodule\n", "module top_module (\n\tinput [2:0] sel,\n\tinput [3:0] data0,\n\tinput [3:0] data1,\n\tinput [3:0] data2,\n\tinput [3:0] data3,\n\tinput [3:0]
{"task_id": "timer", "llmgen_RTL": ["module top_module(\n input clk, \n input load, \n input [9:0] data, \n output reg tc\n);\n reg [9:0] counter;\n \n always @(posedge clk) begin\n if (load) begin\n counter <= data; // Load the counter with data when load is high\n tc <= 0; // Reset terminal count\n end else begin\n if (counter > 0) begin\n counter <= counter - 1; // Decrement the counter\n end\n if (counter == 1) begin\n tc <= 1; // Assert tc when counter reaches 0\n end\n end\n end\nendmodule\n", "module top_module(\n input clk, \n input load, \n input [9:0] data, \n output reg tc\n);\n reg [9:0] counter;\n\n always @(posedge clk) begin\n if (load) begin\n counter <= data;\n tc <= 0; // Reset terminal count when loading\n end else if (counter > 0) begin\n counter <= counter - 1;\n end\n\n if (counter == 0) begin\n tc <= 1;\n end\n end\nendmodule\n", "module top_module(\n input clk, \n input load, \n input [9:0] data, \n output reg tc\n);\n reg [9:0] counter;\n\n always @(posedge clk) begin\n if (load) begin\n counter <= data; \n tc <= 0; \n end else if (counter > 0) begin\n counter <= counter - 1; \n end\n if (counter == 0) begin\n tc <= 1; \n end\n end\nendmodule\n", "module top_module(\n\tinput clk, \n\tinput load, \n\tinput [9:0] data, \n\toutput reg tc\n);\n\treg [9:0] counter;\n\n\talways @(posedge clk) begin\n\t\tif (load) begin\n\t\t\tcounter <= data;\n\t\t\ttc <= 0;\n\t\tend else if (counter > 0) begin\n\t\t\tcounter <= counter - 1;\n\t\t\ttc <= 0;\n\t\tend \n\t\tif (counter == 0) begin\n\t\t\ttc <= 1;\n\t\tend\n\tend\nendmodule\n", "module top_module(\n input clk, \n input load, \n input [9:0] data, \n output reg tc\n);\n reg [9:0] counter;\n\n always @(posedge clk) begin\n if (load) begin\n counter <= data; // Load the data into the counter\n tc <= 0; // Reset terminal count signal\n end else if (counter > 0) begin\n counter <= counter - 1; // Decrement the counter\n end\n if (counter == 1) begin\n tc <= 1; // Assert terminal count when reaching 0\n end\n end\nendmodule\n", "module top_module(\n\tinput clk, \n\tinput load, \n\tinput [9:0] data, \n\toutput reg tc\n);\n\n\treg [9:0] counter;\n\n\talways @(posedge clk) begin\n\t\tif (load) begin\n\t\t\tcounter <= data; // Load new count value\n\t\t\ttc <= 0; // Reset terminal count signal\n\t\tend else if (counter > 0) begin\n\t\t\tcounter <= counter - 1; // Decrement counter\n\t\tend\n\t\t\n\t\tif (counter == 0) begin\n\t\t\ttc <= 1; // Assert terminal count signal\n\t\tend\n\tend\n\nendmodule\n", "module top_module(\n input clk, \n input load, \n input [9:0] data, \n output reg tc\n);\n reg [9:0] counter;\n\n always @(posedge clk) begin\n if (load) begin\n counter <= data; // Load data into counter\n tc <= 0; // Reset terminal count\n end else if (counter > 0) begin\n counter <= counter - 1; // Decrement counter\n end\n \n if (counter == 0) begin\n tc <= 1; // Assert terminal count when counter reaches 0\n end\n end\nendmodule\n", "module top_module(\n input clk, \n input load, \n input [9:0] data, \n output reg tc\n);\n\n reg [9:0] counter;\n\n always @(posedge clk) begin\n if (load) begin\n counter <= data;\n tc <= 0;\n end else if (counter > 0) begin\n counter <= counter - 1;\n if (counter == 1)\n tc <= 1;\n end\n end\n\nendmodule\n", "module top_module(\n input clk, \n input load, \n input [9:0] data, \n output reg tc\n);\n\n reg [9:0] counter;\n\n always @(posedge clk) begin\n
{"task_id": "review2015_fsmseq", "llmgen_RTL": ["module top_module(\n input clk,\n input reset,\n input data,\n output reg start_shifting);\n\n reg [2:0] state;\n \n parameter S0 = 3'b000, \n S1 = 3'b001, \n S2 = 3'b010, \n S3 = 3'b011;\n\n always @(posedge clk) begin\n if (reset) begin\n state <= S0;\n start_shifting <= 0;\n end else begin\n case (state)\n S0: if (data) state <= S1; // 1\n else state <= S0;\n S1: if (data) state <= S2; // 11\n else state <= S0;\n S2: if (!data) state <= S3; // 110\n else state <= S2;\n S3: if (data) begin\n start_shifting <= 1; // 1101 found\n state <= S0; // Reset for new search\n end else \n state <= S0;\n endcase\n end\n end\nendmodule\n", "module top_module(\n input clk,\n input reset,\n input data,\n output reg start_shifting\n);\n\n typedef enum reg [2:0] {\n S0 = 3'b000,\n S1 = 3'b001,\n S2 = 3'b010,\n S3 = 3'b011,\n S4 = 3'b100\n } state_t;\n\n state_t current_state, next_state;\n\n always @(posedge clk) begin\n if (reset) begin\n current_state <= S0;\n start_shifting <= 0;\n end else begin\n current_state <= next_state;\n end\n end\n\n always @(*) begin\n case (current_state)\n S0: begin\n if (data) next_state = S1;\n else next_state = S0;\n start_shifting = 0;\n end\n S1: begin\n if (data) next_state = S2;\n else next_state = S0;\n start_shifting = 0;\n end\n S2: begin\n if (data) next_state = S3;\n else next_state = S0;\n start_shifting = 0;\n end\n S3: begin\n if (data) next_state = S4;\n else next_state = S0;\n start_shifting = 0;\n end\n S4: begin\n next_state = S4;\n start_shifting = 1;\n end\n default: begin\n next_state = S0;\n start_shifting = 0;\n end\n endcase\n end\n\nendmodule\n", "module top_module(\n input clk,\n input reset,\n input data,\n output reg start_shifting\n);\n\n reg [3:0] state, next_state;\n\n parameter IDLE = 0, S1 = 1, S11 = 2, S110 = 3, S1101 = 4;\n\n always @(posedge clk) begin\n if (reset) begin\n state <= IDLE;\n start_shifting <= 0;\n end else begin\n state <= next_state;\n end\n end\n\n always @(*) begin\n case (state)\n IDLE: begin\n if (data) \n next_state = S1;\n else \n next_state = IDLE;\n end\n S1: begin\n if (data) \n next_state = S11;\n else \n next_state = IDLE;\n end\n S11: begin\n if (data) \n next_state = S110;\n else \n next_state = IDLE;\n end\n S110: begin\n if (data) begin\n next_state = S1101;\n start_shifting = 1;\n end else \n next_state = IDLE;\n end\n S1101: begin\n start_shifting = 1; // Remain in start_shifting state\n next_state = S1101; // Stay in this state\n end\n default: next_state = IDLE;\n endcase\n end\n\nendmodule\n", "module top_module(\n input clk,\n input reset,\n input data,\n output reg start_shifting\n);\n\n typedef enum reg [2:0]
{"task_id": "dff8r", "llmgen_RTL": ["module top_module(\n input clk,\n input [7:0] d,\n input reset,\n output reg [7:0] q\n);\n always @(posedge clk) begin\n if (reset) begin\n q <= 8'b0;\n end else begin\n q <= d;\n end\n end\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput [7:0] d,\n\tinput reset,\n\toutput reg [7:0] q);\n\n\talways @(posedge clk) begin\n\t\tif (reset) begin\n\t\t\tq <= 8'b00000000;\n\t\tend else begin\n\t\t\tq <= d;\n\t\tend\n\tend\nendmodule\n", "module top_module(\n input clk,\n input [7:0] d,\n input reset,\n output reg [7:0] q);\n\n always @(posedge clk) begin\n if (reset) begin\n q <= 8'b00000000;\n end else begin\n q <= d;\n end\n end\nendmodule\n", "module top_module(\n input clk,\n input [7:0] d,\n input reset,\n output reg [7:0] q\n);\n always @(posedge clk) begin\n if (reset) begin\n q <= 8'b0;\n end else begin\n q <= d;\n end\n end\nendmodule\n", "module top_module(\n input clk,\n input [7:0] d,\n input reset,\n output reg [7:0] q\n);\n\nalways @(posedge clk or posedge reset) begin\n if (reset) begin\n q <= 8'b0;\n end else begin\n q <= d;\n end\nend\n\nendmodule\n", "module top_module(\n input clk,\n input [7:0] d,\n input reset,\n output reg [7:0] q\n);\n\n always @(posedge clk) begin\n if (reset) begin\n q <= 8'b0;\n end else begin\n q <= d;\n end\n end\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput [7:0] d,\n\tinput reset,\n\toutput reg [7:0] q);\n\n\talways @(posedge clk or posedge reset) begin\n\t\tif (reset) begin\n\t\t\tq <= 8'b00000000;\n\t\tend else begin\n\t\t\tq <= d;\n\t\tend\n\tend\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput [7:0] d,\n\tinput reset,\n\toutput reg [7:0] q);\n \n\talways @(posedge clk) begin\n\t\tif (reset) begin\n\t\t\tq <= 8'b0;\n\t\tend else begin\n\t\t\tq <= d;\n\t\tend\n\tend\n \nendmodule\n", "module top_module(\n input clk,\n input [7:0] d,\n input reset,\n output reg [7:0] q\n);\n\nalways @(posedge clk) begin\n if (reset) begin\n q <= 8'b00000000;\n end else begin\n q <= d;\n end\nend\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput [7:0] d,\n\tinput reset,\n\toutput reg [7:0] q);\n\nalways @(posedge clk) begin\n\tif (reset) begin\n\t\tq <= 8'b00000000;\n\tend else begin\n\t\tq <= d;\n\tend\nend\n\nendmodule\n", "module top_module(\n input clk,\n input [7:0] d,\n input reset,\n output reg [7:0] q\n);\n always @(posedge clk or posedge reset) begin\n if (reset) begin\n q <= 8'b00000000;\n end else begin\n q <= d;\n end\n end\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput [7:0] d,\n\tinput reset,\n\toutput reg [7:0] q);\n\n\talways @(posedge clk) begin\n\t\tif (reset) begin\n\t\t\tq <= 8'b00000000;\n\t\tend else begin\n\t\t\tq <= d;\n\t\tend\n\tend\nendmodule\n", "module top_module(\n input clk,\n input [7:0] d,\n input reset,\n output reg [7:0] q);\n \n always @(posedge clk or posedge reset) begin\n if (reset) begin\n q <= 8'b0;\n end else begin\n q <= d;\n end\n end\n\nendmodule\n", "module top_module(\n input clk,\n input [7:0] d,\n input reset,\n output reg [7:0] q);\n\n always @(posedge clk) begin\n if (reset) begin\n q <= 8'b00000000;\n end else begin\n q <= d;\n end\n end\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput [7:0] d,\n\tinput reset,\n\toutput reg [7:0] q);\n\n\talways @(posedge clk) begin\n\t\tif (reset) begin\n\t\t\tq <= 8'b0;\n\t\tend else begin\n\t\t\tq <= d;\n\t\tend\n\tend\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput [7:0] d,\n\tinput reset,\n\toutput reg [7:0] q);\n\n\talways @(posedge clk) begin\n\t\tif (reset) begin\n\t\t\tq <= 8'b0;\n\t\tend else begin\n\t
{"task_id": "edgedetect2", "llmgen_RTL": ["module top_module(\n\tinput clk,\n\tinput [7:0] in,\n\toutput reg [7:0] anyedge);\n\nreg [7:0] in_d;\n\nalways @(posedge clk) begin\n\tin_d <= in;\n\tanyedge <= 8'b0; // Reset anyedge\n\tanyedge <= (in & ~in_d); // Detect 0 to 1 transitions\nend\n\nendmodule\n", "module top_module(\n input clk,\n input [7:0] in,\n output reg [7:0] anyedge);\n \n reg [7:0] in_prev;\n\n always @(posedge clk) begin\n anyedge <= (in & ~in_prev);\n in_prev <= in;\n end\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput [7:0] in,\n\toutput reg [7:0] anyedge);\n\nreg [7:0] in_d;\n\nalways @(posedge clk) begin\n\tin_d <= in;\n\tanyedge <= (in & ~in_d);\nend\n\nendmodule\n", "module top_module(\n input clk,\n input [7:0] in,\n output reg [7:0] anyedge\n);\n reg [7:0] in_prev;\n\n always @(posedge clk) begin\n anyedge <= (in & ~in_prev);\n in_prev <= in;\n end\nendmodule\n", "module top_module(\n input clk,\n input [7:0] in,\n output reg [7:0] anyedge\n);\n\n reg [7:0] in_prev;\n\n always @(posedge clk) begin\n anyedge <= (in & ~in_prev);\n in_prev <= in;\n end\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput [7:0] in,\n\toutput reg [7:0] anyedge);\n\n\treg [7:0] in_reg;\n\n\talways @(posedge clk) begin\n\t\tanyedge <= (in_reg & ~in) | (anyedge & ~in);\n\t\tin_reg <= in;\n\tend\n\nendmodule\n", "module top_module(\n input clk,\n input [7:0] in,\n output reg [7:0] anyedge\n);\n reg [7:0] in_d;\n\n always @(posedge clk) begin\n anyedge <= (in & ~in_d);\n in_d <= in;\n end\nendmodule\n", "module top_module(\n input clk,\n input [7:0] in,\n output reg [7:0] anyedge\n);\n reg [7:0] in_prev;\n\n always @(posedge clk) begin\n anyedge <= (in & ~in_prev);\n in_prev <= in;\n end\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput [7:0] in,\n\toutput reg [7:0] anyedge);\n\n\treg [7:0] prev_in;\n\n\talways @(posedge clk) begin\n\t\tanyedge <= (in & ~prev_in);\n\t\tprev_in <= in;\n\tend\n\nendmodule\n", "module top_module(\n input clk,\n input [7:0] in,\n output reg [7:0] anyedge\n);\n reg [7:0] in_prev;\n\n always @(posedge clk) begin\n anyedge <= (in & ~in_prev);\n in_prev <= in;\n end\nendmodule\n", "module top_module(\n input clk,\n input [7:0] in,\n output reg [7:0] anyedge\n);\n\nreg [7:0] prev_in;\n\nalways @(posedge clk) begin\n anyedge <= (prev_in ^ in) & (in & ~prev_in);\n prev_in <= in;\nend\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput [7:0] in,\n\toutput reg [7:0] anyedge\n);\n\nreg [7:0] in_prev;\n\nalways @(posedge clk) begin\n\tanyedge <= (in & ~in_prev);\n\tin_prev <= in;\nend\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput [7:0] in,\n\toutput reg [7:0] anyedge);\n\nreg [7:0] prev_in;\n\nalways @(posedge clk) begin\n\tanyedge <= (in & ~prev_in);\n\tprev_in <= in;\nend\n\nendmodule\n", "module top_module(\n input clk,\n input [7:0] in,\n output reg [7:0] anyedge\n);\n\nreg [7:0] in_prev;\n\nalways @(posedge clk) begin\n anyedge <= (in & ~in_prev);\n in_prev <= in;\nend\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput [7:0] in,\n\toutput reg [7:0] anyedge);\n\n\treg [7:0] in_d; // Register to store previous state of input\n\n\talways @(posedge clk) begin\n\t\tanyedge <= (in & ~in_d); // Set output to 1 where the transition from 0 to 1 occurred\n\t\tin_d <= in; // Update previous state\n\tend\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput [7:0] in,\n\toutput reg [7:0] anyedge);\n\n\treg [7:0] prev_in;\n\n\talways @(posedge clk) begin\n\t\tanyedge <= ((in & ~prev_in) | (prev_in & ~in));\n\t\tprev_in <= in;\n\tend\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput [7:0] in,\n\toutput reg [7:0] anyedge);\n\n\treg [7:0] prev_in;\n\n\talways @(posedge clk) begin\n\t\tanyedge <= (in & ~prev_in);\n\t\tprev_in <= in;\n\tend\n\nendmodule\n", "module top_module(\n input clk,\n input [7:0] in,\n output
{"task_id": "count1to10", "llmgen_RTL": ["module top_module(\n\tinput clk,\n\tinput reset,\n\toutput reg [3:0] q);\n\n\talways @(posedge clk) begin\n\t\tif (reset) begin\n\t\t\tq <= 4'd1;\n\t\tend else if (q < 4'd10) begin\n\t\t\tq <= q + 1;\n\t\tend else begin\n\t\t\tq <= 4'd1; \n\t\tend\n\tend\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput reset,\n\toutput reg [3:0] q);\n\n\talways @(posedge clk) begin\n\t\tif (reset) begin\n\t\t\tq <= 4'd1;\n\t\tend else if (q < 4'd10) begin\n\t\t\tq <= q + 1;\n\t\tend else begin\n\t\t\tq <= 4'd1;\n\t\tend\n\tend\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput reset,\n\toutput reg [3:0] q);\n\n\talways @(posedge clk) begin\n\t\tif (reset) begin\n\t\t\tq <= 4'b0001; // Reset to 1\n\t\tend else if (q < 4'b1010) begin\n\t\t\tq <= q + 1; // Count from 1 to 10\n\t\tend else begin\n\t\t\tq <= 4'b0001; // Reset to 1 after reaching 10\n\t\tend\n\tend\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput reset,\n\toutput reg [3:0] q);\n\nalways @(posedge clk) begin\n\tif (reset) begin\n\t\tq <= 4'b0001; // Reset to 1\n\tend else if (q < 4'b1010) begin\n\t\tq <= q + 1; // Count up to 10\n\tend else begin\n\t\tq <= 4'b0001; // Reset to 1 after reaching 10\n\tend\nend\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput reset,\n\toutput reg [3:0] q);\n\n\talways @(posedge clk) begin\n\t\tif (reset) \n\t\t\tq <= 4'b0001; // Reset to 1\n\t\telse if (q < 4'b1010) \n\t\t\tq <= q + 1; // Count up to 10\n\tend\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput reset,\n\toutput reg [3:0] q);\n\n\talways @(posedge clk) begin\n\t\tif (reset) begin\n\t\t\tq <= 4'b0001; // Reset to 1\n\t\tend else if (q < 4'b1010) begin\n\t\t\tq <= q + 1; // Increment counter\n\t\tend else begin\n\t\t\tq <= 4'b0001; // Reset to 1 after reaching 10\n\t\tend\n\tend\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput reset,\n\toutput reg [3:0] q);\n\nalways @(posedge clk) begin\n\tif (reset) begin\n\t\tq <= 4'b0001; // Reset to 1\n\tend else if (q < 4'b1010) begin\n\t\tq <= q + 1; // Count from 1 to 10\n\tend else begin\n\t\tq <= 4'b0001; // Reset back to 1 after reaching 10\n\tend\nend\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput reset,\n\toutput reg [3:0] q);\n\nalways @(posedge clk) begin\n\tif (reset) begin\n\t\tq <= 4'b0001; // Reset the counter to 1\n\tend else if (q < 4'b1010) begin\n\t\tq <= q + 1; // Increment the counter\n\tend else begin\n\t\tq <= 4'b0001; // Reset back to 1 after reaching 10\n\tend\nend\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput reset,\n\toutput reg [3:0] q);\n\n\talways @(posedge clk) begin\n\t\tif (reset) begin\n\t\t\tq <= 4'b0001; // Reset to 1\n\t\tend else if (q < 4'b1010) begin\n\t\t\tq <= q + 1; // Count from 1 to 10\n\t\tend else begin\n\t\t\tq <= 4'b0001; // Reset to 1 after reaching 10\n\t\tend\n\tend\nendmodule\n", "module top_module(\n input clk,\n input reset,\n output reg [3:0] q);\n\n always @(posedge clk) begin\n if (reset) begin\n q <= 4'd1;\n end else begin\n if (q < 4'd10) begin\n q <= q + 1;\n end else begin\n q <= 4'd1;\n end\n end\n end\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput reset,\n\toutput reg [3:0] q);\n\nalways @(posedge clk) begin\n\tif (reset) begin\n\t\tq <= 4'b0001;\n\tend else if (q < 4'b1010) begin\n\t\tq <= q + 1;\n\tend else begin\n\t\tq <= 4'b0001;\n\tend\nend\n\nendmodule\n", "module top_module(\n input clk,\n input reset,\n output reg [3:0] q\n);\n\nalways @(posedge clk) begin\n if (reset) begin\n q <= 4'b0001; // Reset counter to 1\n end else if (q < 4'b1010) begin\n q <= q + 1; // Count up to 10\n end else begin\n q <= 4'b0001; // Reset to 1 after reaching 10\n end\nend\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput reset,\n\toutput reg [3:0] q);\n \n\talways @(posedge clk or posedge reset) begin\n\t\tif (reset) begin\n\t\t\tq <= 4'b0001; // Reset counter to 1\n\t\tend else begin\n\t\t\tif (q < 4
{"task_id": "circuit9", "llmgen_RTL": ["module top_module (\n\tinput clk,\n\tinput a, \n\toutput reg [2:0] q\n);\n \n\talways @(posedge clk) begin\n\t\tif (a) begin\n\t\t\tif (q == 3'd4)\n\t\t\t\tq <= 3'd4;\n\t\t\telse\n\t\t\t\tq <= q + 1;\n\t\tend else begin\n\t\t\tif (q != 3'd0)\n\t\t\t\tq <= q - 1;\n\t\tend\n\tend\n\t\nendmodule\n", "module top_module (\n input clk,\n input a, \n output reg [2:0] q\n);\n\n always @(posedge clk) begin\n if (a) begin\n if (q == 3'd0) \n q <= 3'd4;\n else if (q == 3'd1)\n q <= 3'd0;\n else\n q <= q + 1'b1;\n end\n end\n\n initial begin\n q = 3'd0;\n end\n\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput a, \n\toutput reg [2:0] q\n);\n\n\talways @(posedge clk) begin\n\t\tif (a) begin\n\t\t\tif (q == 3'b111) \n\t\t\t\tq <= 3'b000;\n\t\t\telse \n\t\t\t\tq <= q + 1;\n\t\tend\n\tend\n\n\talways @(negedge clk) begin\n\t\tif (!a) \n\t\t\tq <= q;\n\tend\n\nendmodule\n", "module top_module (\n input clk,\n input a, \n output reg [2:0] q\n);\n always @(posedge clk) begin\n if (a) begin\n if (q == 3'b100) begin\n q <= 3'b100;\n end else begin\n q <= q + 1;\n end\n end else begin\n if (q > 0) begin\n q <= q - 1;\n end\n end\n end\nendmodule\n", "module top_module (\n input clk,\n input a, \n output reg [2:0] q\n);\n\n always @(posedge clk) begin\n if (a) begin\n q <= q + 1;\n end else begin\n q <= 0;\n end\n end\n\nendmodule\n", "module top_module (\n input clk,\n input a, \n output reg [2:0] q\n);\n always @(posedge clk) begin\n if (a) begin\n if (q == 3'd4) begin\n q <= 3'd4;\n end else if (q == 3'd5) begin\n q <= 3'd6;\n end else if (q == 3'd6) begin\n q <= 3'd0;\n end else begin\n q <= q + 1;\n end\n end else begin\n q <= q;\n end\n end\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput a, \n\toutput reg [2:0] q\n);\n\t\n\talways @(posedge clk) begin\n\t\tif (a) begin\n\t\t\tif (q == 3'b111) \n\t\t\t\tq <= 3'b000; // wrap around if maximum value reached\n\t\t\telse \n\t\t\t\tq <= q + 1; // increment q\n\t\tend\n\tend\n\t\n\talways @(negedge clk) begin\n\t\tif (!a)\n\t\t\tq <= q; // hold value on the negative edge if a is 0\n\tend\n\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput a, \n\toutput reg [2:0] q\n);\n\n\talways @(posedge clk) begin\n\t\tif (a) begin\n\t\t\tif (q == 3'b111) \n\t\t\t\tq <= 3'b000;\n\t\t\telse \n\t\t\t\tq <= q + 1;\n\t\tend else begin\n\t\t\tq <= q;\n\t\tend\n\tend\n\nendmodule\n", "module top_module (\n input clk,\n input a, \n output reg [2:0] q\n);\n always @(posedge clk) begin\n if (a) begin\n if (q == 3'b111) \n q <= 3'b000;\n else \n q <= q + 1;\n end\n end\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput a, \n\toutput reg [2:0] q\n);\n\n\talways @(posedge clk) begin\n\t\tif (a) begin\n\t\t\tif (q == 3'b111) \n\t\t\t\tq <= 3'b000; \n\t\t\telse \n\t\t\t\tq <= q + 1; \n\t\tend\n\tend\n\nendmodule\n", "module top_module (\n input clk,\n input a, \n output reg [2:0] q\n);\n \n always @(posedge clk) begin\n if (a) begin\n if (q == 3'b111) q <= 3'b000; // Reset to 0 if the counter reaches 7\n else q <= q + 1; // Increment the counter\n end\n end\n\nendmodule\n", "module top_module (\n input clk,\n input a, \n output reg [2:0] q\n);\n always @(posedge clk) begin\n if (a) begin\n if (q == 3'd5)\n q <= 3'd6;\n else if (q == 3'd6)\n q <= 3'd0;\n else\n q <= q + 3'd1;\n end\n end\n\n always @(negedge clk) begin\n if (!a)\
{"task_id": "lfsr5", "llmgen_RTL": ["module top_module(\n\tinput clk,\n\tinput reset,\n\toutput reg [4:0] q);\n\n\talways @(posedge clk or posedge reset) begin\n\t\tif (reset) begin\n\t\t\tq <= 5'b00001; // Reset to 1\n\t\tend else begin\n\t\t\tq <= {q[3:0], q[4] ^ q[2]}; // Shift and XOR for taps at positions 5 and 3\n\t\tend\n\tend\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput reset,\n\toutput reg [4:0] q);\n\n\talways @(posedge clk or posedge reset) begin\n\t\tif (reset) begin\n\t\t\tq <= 5'b00001; // Reset to 1\n\t\tend else begin\n\t\t\tq <= {q[3:0], q[4] ^ q[2]}; // Shift and XOR for taps at positions 5 and 3\n\t\tend\n\tend\nendmodule\n", "module top_module(\n input clk,\n input reset,\n output reg [4:0] q\n);\n \n always @(posedge clk or posedge reset) begin\n if (reset) begin\n q <= 5'b00001; // Reset to 1\n end else begin\n q[4] <= q[3]; // Shift left\n q[3] <= q[2];\n q[2] <= q[1];\n q[1] <= q[0] ^ q[4]; // Tap at position 5\n q[0] <= q[0] ^ q[2]; // Tap at position 3\n end\n end\n\nendmodule\n", "module top_module(\n input clk,\n input reset,\n output reg [4:0] q\n);\n\n always @(posedge clk or posedge reset) begin\n if (reset) begin\n q <= 5'b00001; // Reset to 1\n end else begin\n q <= {q[3] ^ q[4], q[4:1]}; // Galois LFSR feedback\n end\n end\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput reset,\n\toutput reg [4:0] q);\n\n\talways @(posedge clk or posedge reset) begin\n\t\tif (reset) begin\n\t\t\tq <= 5'b00001; // Reset to 1\n\t\tend else begin\n\t\t\t// Galois LFSR with taps at positions 5 and 3\n\t\t\tq[4] <= q[3] ^ q[4]; // tap positions 5 and 3\n\t\t\tq[3] <= q[2];\n\t\t\tq[2] <= q[1];\n\t\t\tq[1] <= q[0];\n\t\t\tq[0] <= 1'b0; // Shift in zero\n\t\tend\n\tend\nendmodule\n", "module top_module(\n input clk,\n input reset,\n output reg [4:0] q);\n\n always @(posedge clk or posedge reset) begin\n if (reset) begin\n q <= 5'b00001; // Reset to 1\n end else begin\n q <= {q[3], q[2], q[1], q[0], q[4] ^ q[2]}; // Galois LFSR with taps at bit positions 5 and 3\n end\n end\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput reset,\n\toutput reg [4:0] q);\n\n\talways @(posedge clk or posedge reset) begin\n\t\tif (reset) begin\n\t\t\tq <= 5'b00001; // Reset to 1\n\t\tend else begin\n\t\t\t// Galois LFSR with taps at position 5 and 3\n\t\t\tq <= {q[3:0], q[4] ^ q[2]}; \n\t\tend\n\tend\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput reset,\n\toutput reg [4:0] q);\n\n\talways @(posedge clk or posedge reset) begin\n\t\tif (reset) begin\n\t\t\tq <= 5'b00001; // Reset to 1\n\t\tend else begin\n\t\t\tq <= {q[3:0], q[4] ^ q[2]}; // Shift and tap feedback\n\t\tend\n\tend\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput reset,\n\toutput reg [4:0] q);\n\t\n\talways @(posedge clk or posedge reset) begin\n\t\tif (reset) begin\n\t\t\tq <= 5'b00001; // Reset to 1\n\t\tend else begin\n\t\t\tq <= {q[3:0], (q[4] ^ q[2])}; // Shift and XOR tap bits at positions 5 and 3\n\t\tend\n\tend\nendmodule\n", "module top_module(\n input clk,\n input reset,\n output reg [4:0] q);\n\n always @(posedge clk or posedge reset) begin\n if (reset) begin\n q <= 5'b00001; // Reset to 1\n end else begin\n // Galois LFSR with taps at positions 5 and 3\n q <= {q[3] ^ q[4], q[4:1]};\n end\n end\nendmodule\n", "module top_module(\n input clk,\n input reset,\n output reg [4:0] q\n);\n always @(posedge clk or posedge reset) begin\n if (reset) begin\n q <= 5'b00001; // Reset to 1\n end else begin\n q <= {q[3] ^ q[4], q[4:1]}; // Galois LFSR with taps at 5 and 3\n end\n end\nendmodule\n", "module top_module(\n input clk,\n input reset,\n output reg [4:0] q);\n \n always @(posedge clk or posedge reset) begin\n if (reset) begin\n q <= 5'b
{"task_id": "bugs_addsubz", "llmgen_RTL": ["module top_module (\n input do_sub,\n input [7:0] a,\n input [7:0] b,\n output reg [7:0] out,\n output reg result_is_zero\n);\n\n always @(*) begin\n if (do_sub) \n out = a - b;\n else \n out = a + b;\n\n result_is_zero = (out == 8'b0); // Fixed condition to check if out is zero\n end\n\nendmodule\n", "module top_module (\n\tinput do_sub,\n\tinput [7:0] a,\n\tinput [7:0] b,\n\toutput reg [7:0] out,\n\toutput reg result_is_zero\n);\n\n\talways @(*) begin\n\t\tif (do_sub)\n\t\t\tout = a - b;\n\t\telse\n\t\t\tout = a + b;\n\n\t\tresult_is_zero = (out == 8'b0);\n\tend\n\nendmodule\n", "module top_module (\n\tinput do_sub,\n\tinput [7:0] a,\n\tinput [7:0] b,\n\toutput reg [7:0] out,\n\toutput reg result_is_zero\n);\n\n\talways @(*) begin\n\t\tif (do_sub)\n\t\t\tout = a - b;\n\t\telse\n\t\t\tout = a + b;\n\n\t\tresult_is_zero = (out == 8'b0);\n\tend\n\nendmodule\n", "module top_module (\n input do_sub,\n input [7:0] a,\n input [7:0] b,\n output reg [7:0] out,\n output reg result_is_zero\n);\n\n always @(*) begin\n if (do_sub) begin\n out = a - b;\n end else begin\n out = a + b;\n end\n\n result_is_zero = (out == 8'b0);\n end\n\nendmodule\n", "module top_module (\n\tinput do_sub,\n\tinput [7:0] a,\n\tinput [7:0] b,\n\toutput reg [7:0] out,\n\toutput reg result_is_zero\n);\n\n\talways @(*) begin\n\t\tif (do_sub) \n\t\t\tout = a - b;\n\t\telse \n\t\t\tout = a + b;\n\n\t\tresult_is_zero = (out == 8'b0) ? 1'b1 : 1'b0;\n\tend\n\nendmodule\n", "module top_module (\n\tinput do_sub,\n\tinput [7:0] a,\n\tinput [7:0] b,\n\toutput reg [7:0] out,\n\toutput reg result_is_zero\n);\n\n\talways @(*) begin\n\t\tif (do_sub) \n\t\t\tout = a - b;\n\t\telse \n\t\t\tout = a + b;\n\n\t\tresult_is_zero = (out == 8'b0);\n\tend\n\nendmodule\n", "module top_module (\n\tinput do_sub,\n\tinput [7:0] a,\n\tinput [7:0] b,\n\toutput reg [7:0] out,\n\toutput reg result_is_zero\n);\n\n\talways @(*) begin\n\t\tif (do_sub == 1'b0)\n\t\t\tout = a + b;\n\t\telse\n\t\t\tout = a - b;\n\n\t\tresult_is_zero = (out == 8'b0) ? 1'b1 : 1'b0;\n\tend\n\nendmodule\n", "module top_module (\n input do_sub,\n input [7:0] a,\n input [7:0] b,\n output reg [7:0] out,\n output reg result_is_zero\n);\n\n always @(*) begin\n if (do_sub) \n out = a - b;\n else \n out = a + b;\n\n result_is_zero = (out == 8'b0);\n end\n\nendmodule\n", "module top_module (\n\tinput do_sub,\n\tinput [7:0] a,\n\tinput [7:0] b,\n\toutput reg [7:0] out,\n\toutput reg result_is_zero\n);\n\talways @(*) begin\n\t\tif (do_sub == 1'b0)\n\t\t\tout = a + b;\n\t\telse\n\t\t\tout = a - b;\n\n\t\tresult_is_zero = (out == 8'b0) ? 1'b1 : 1'b0;\n\tend\nendmodule\n", "module top_module (\n input do_sub,\n input [7:0] a,\n input [7:0] b,\n output reg [7:0] out,\n output reg result_is_zero\n);\n\n always @(*) begin\n if (do_sub)\n out = a - b;\n else\n out = a + b;\n\n result_is_zero = (out == 8'b00000000);\n end\n\nendmodule\n", "module top_module (\n input do_sub,\n input [7:0] a,\n input [7:0] b,\n output reg [7:0] out,\n output reg result_is_zero\n);\n\n always @(*) begin\n if (do_sub) \n out = a - b;\n else \n out = a + b;\n\n result_is_zero = (out == 8'b00000000);\n end\n\nendmodule\n", "module top_module (\n input do_sub,\n input [7:0] a,\n input [7:0] b,\n output reg [7:0] out,\n output reg result_is_zero\n);\n\n always @(*) begin\n if (do_sub) begin\n out = a - b;\n end else begin\n out = a + b;\n end\n\n result_is_zero = (out == 8'b00000000);\n end\n\nendmodule\n", "module top_module (\n input do_sub,\n input [7:0] a,\n input [7:0] b,\n output reg [7:0] out,\n output reg result_is_zero\n);\n\n always @(*) begin\n if (do_sub) begin\n out = a - b
{"task_id": "m2014_q3", "llmgen_RTL": ["module top_module (\n input [4:1] x,\n output logic f\n);\n always_comb begin\n case ({x[3], x[4], x[1], x[2]})\n 4'b0000: f = 1'b0; // d\n 4'b0001: f = 1'b0; // 0\n 4'b0011: f = 1'b0; // d\n 4'b0010: f = 1'b0; // d\n 4'b0100: f = 1'b0; // 0\n 4'b0101: f = 1'b1; // 1\n 4'b0111: f = 1'b1; // 1\n 4'b0110: f = 1'b0; // 0\n 4'b1000: f = 1'b1; // 1\n 4'b1001: f = 1'b1; // 1\n 4'b1011: f = 1'b0; // 0\n 4'b1010: f = 1'bd; // d\n 4'b1100: f = 1'bd; // d\n 4'b1101: f = 1'bd; // d\n 4'b1111: f = 1'bd; // d\n 4'b1110: f = 1'bd; // d\n default: f = 1'b0; // default case\n endcase\n end\nendmodule\n", "module top_module (\n input [4:1] x,\n output logic f\n);\n always_comb begin\n case ({x[3], x[4], x[1], x[2]})\n 4'b0000: f = 1'b0; // 00 00\n 4'b0001: f = 1'b0; // 00 01\n 4'b0010: f = 1'bx; // 00 10 (don't care)\n 4'b0011: f = 1'bx; // 00 11 (don't care)\n 4'b0100: f = 1'b0; // 01 00\n 4'b0101: f = 1'bx; // 01 01 (don't care)\n 4'b0110: f = 1'b1; // 01 10\n 4'b0111: f = 1'b0; // 01 11\n 4'b1000: f = 1'b1; // 10 00\n 4'b1001: f = 1'b1; // 10 01\n 4'b1010: f = 1'b0; // 10 10\n 4'b1011: f = 1'bx; // 10 11 (don't care)\n 4'b1100: f = 1'b1; // 11 00\n 4'b1101: f = 1'b1; // 11 01\n 4'b1110: f = 1'bx; // 11 10 (don't care)\n 4'b1111: f = 1'bx; // 11 11 (don't care)\n default: f = 1'bx; // Unknown input\n endcase\n end\nendmodule\n", "module top_module (\n input [4:1] x,\n output logic f\n);\n always_comb begin\n case ({x[4], x[3], x[2], x[1]})\n 4'b0000: f = 1'bx; // don't care\n 4'b0001: f = 1'b0;\n 4'b0010: f = 1'bx; // don't care\n 4'b0011: f = 1'bx; // don't care\n 4'b0100: f = 1'b0;\n 4'b0101: f = 1'bx; // don't care\n 4'b0110: f = 1'b1;\n 4'b0111: f = 1'b0;\n 4'b1000: f = 1'b1;\n 4'b1001: f = 1'b1;\n 4'b1010: f = 1'b0;\n 4'b1011: f = 1'bx; // don't care\n 4'b1100: f = 1'b1;\n 4'b1101: f = 1'b1;\n 4'b1110: f = 1'bx; // don't care\n 4'b1111: f = 1'bx; // don't care\n default: f = 1'b0; // default case\n endcase\n end\nendmodule\n", "module top_module (\n input [4:1] x,\n output logic f\n);\n\n always_comb begin\n case ({x[4], x[3], x[2], x[1]})\n 4'b0000: f = 1'bx; // d\n 4'b0001: f = 1'b0; // 0\n 4'b0010: f = 1'bx; // d\n 4'b0011: f = 1'bx; // d\n 4'b0100: f = 1'b0; // 0\n 4'b0101: f = 1'bx; // d\n 4'b0110: f = 1'b1; // 1\n 4'b0111: f = 1'b0; // 0\n 4'b1000: f = 1'b1; // 1\n 4'b1001: f = 1'b1; // 1\n 4'b1010: f = 1'b0; // 0\n 4'b1011: f = 1'bx; // d\n 4'b1100: f = 1'bx; // d\n 4'b1101: f = 1'bx; // d\n 4'b1110: f = 1'bx; // d\n 4'b1111: f = 1'bx; // d\n default: f = 1'bx; // don't care\n endcase\n end\n\nendmodule\n", "module top_module (\n\tinput [4:1] x,\n\toutput logic f\n);\n always_comb begin\n case ({x[4], x[3], x[2], x[1]})\n 4'b0000: f = 1'bx; // d\n 4'b0001: f = 1'b0; \n 4'b0010: f = 1'bx; // d\n 4'b0011: f = 1'bx; // d\n 4'b0100: f = 1'b0; \n 4'b0101: f = 1'bx; // d\n 4'b0110: f = 1'b1; \n 4'b0111: f = 1'b0; \n 4'b1000: f = 1'b1; \n 4'b1001: f = 1'b1; \n 4'b1010: f = 1'b0; \n 4'b1011: f = 1'bx; // d\n 4'b1100: f = 1'bx; // d\n 4'b1101: f = 1'bx; // d\n 4'b1110:
{"task_id": "bugs_case", "llmgen_RTL": ["module top_module (\n input [7:0] code,\n output reg [3:0] out,\n output reg valid\n);\n\nalways @(*) begin\n case (code)\n 8'h45: begin out = 4'd0; valid = 1'b1; end\n 8'h16: begin out = 4'd1; valid = 1'b1; end\n 8'h1e: begin out = 4'd2; valid = 1'b1; end\n 8'h26: begin out = 4'd3; valid = 1'b1; end\n 8'h25: begin out = 4'd4; valid = 1'b1; end\n 8'h2e: begin out = 4'd5; valid = 1'b1; end\n 8'h36: begin out = 4'd6; valid = 1'b1; end\n 8'h3d: begin out = 4'd7; valid = 1'b1; end\n 8'h3e: begin out = 4'd8; valid = 1'b1; end\n 8'h46: begin out = 4'd9; valid = 1'b1; end\n default: begin out = 4'd0; valid = 1'b0; end\n endcase\nend\n\nendmodule\n", "module top_module (\n\tinput [7:0] code,\n\toutput reg [3:0] out,\n\toutput reg valid\n);\n\nalways @(*) begin\n\tvalid = 0;\n\tout = 4'b0000;\n\n\tcase (code)\n\t\t8'h45: begin out = 4'b0000; valid = 1; end // '0'\n\t\t8'h16: begin out = 4'b0001; valid = 1; end // '1'\n\t\t8'h1e: begin out = 4'b0010; valid = 1; end // '2'\n\t\t8'h26: begin out = 4'b0011; valid = 1; end // '3'\n\t\t8'h25: begin out = 4'b0100; valid = 1; end // '4'\n\t\t8'h2e: begin out = 4'b0101; valid = 1; end // '5'\n\t\t8'h36: begin out = 4'b0110; valid = 1; end // '6'\n\t\t8'h3d: begin out = 4'b0111; valid = 1; end // '7'\n\t\t8'h3e: begin out = 4'b1000; valid = 1; end // '8'\n\t\t8'h46: begin out = 4'b1001; valid = 1; end // '9'\n\t\tdefault: begin out = 4'b0000; valid = 0; end\n\tendcase\nend\n\nendmodule\n", "module top_module (\n\tinput [7:0] code,\n\toutput reg [3:0] out,\n\toutput reg valid\n);\n\nalways @(*) begin\n\tcase (code)\n\t\t8'h45: begin out = 4'd0; valid = 1'b1; end\n\t\t8'h16: begin out = 4'd1; valid = 1'b1; end\n\t\t8'h1e: begin out = 4'd2; valid = 1'b1; end\n\t\t8'h26: begin out = 4'd3; valid = 1'b1; end\n\t\t8'h25: begin out = 4'd4; valid = 1'b1; end\n\t\t8'h2e: begin out = 4'd5; valid = 1'b1; end\n\t\t8'h36: begin out = 4'd6; valid = 1'b1; end\n\t\t8'h3d: begin out = 4'd7; valid = 1'b1; end\n\t\t8'h3e: begin out = 4'd8; valid = 1'b1; end\n\t\t8'h46: begin out = 4'd9; valid = 1'b1; end\n\t\tdefault: begin out = 4'd0; valid = 1'b0; end\n\tendcase\nend\n\nendmodule\n", "module top_module (\n\tinput [7:0] code,\n\toutput reg [3:0] out,\n\toutput reg valid\n);\n\talways @(*) begin\n\t\tcase (code)\n\t\t\t8'h45: begin out = 4'd0; valid = 1; end\n\t\t\t8'h16: begin out = 4'd1; valid = 1; end\n\t\t\t8'h1e: begin out = 4'd2; valid = 1; end\n\t\t\t8'h26: begin out = 4'd3; valid = 1; end\n\t\t\t8'h25: begin out = 4'd4; valid = 1; end\n\t\t\t8'h2e: begin out = 4'd5; valid = 1; end\n\t\t\t8'h36: begin out = 4'd6; valid = 1; end\n\t\t\t8'h3d: begin out = 4'd7; valid = 1; end\n\t\t\t8'h3e: begin out = 4'd8; valid = 1; end\n\t\t\t8'h46: begin out = 4'd9; valid = 1; end\n\t\t\tdefault: begin out = 4'd0; valid = 0; end\n\t\tendcase\n\tend\nendmodule\n", "module top_module (\n input [7:0] code,\n output reg [3:0] out,\n output reg valid\n);\n always @(*) begin\n case (code)\n 8'h45: begin out = 4'd0; valid = 1'b1; end\n 8'h16: begin out = 4'd1; valid = 1'b1; end\n 8'h1e: begin out = 4'd2; valid = 1'b1; end\n 8'h26: begin out = 4'd3; valid = 1'b1; end\n 8'h25: begin out = 4'd4; valid = 1'b1; end\n 8'h2e: begin out = 4'd5; valid = 1'b1; end\n 8'h36: begin out = 4'd6; valid = 1'b1; end\n 8'h3d: begin out = 4'd7; valid = 1'b1; end\n 8'h3e: begin out = 4'd8; valid = 1'b1; end\n 8'h46: begin out = 4'd9; valid = 1'b1; end\n default: begin out = 4'd0; valid = 1'b0; end\n endcase\n end\nendmodule\n", "module top_module (\n\tinput [7:0] code,\n\toutput reg [3:0] out,\n\toutput reg valid\n);\n\talways @(*) begin\n\t\tcase (code)\n\t\t\t8'h45: begin out = 4'd0; valid = 1; end\n\t\t\t8'h16: begin out = 4'd1; valid = 1; end\n\t\t\t8'h1e: begin out = 4'd2; valid = 1; end\n\t\t\t8'h26: begin out = 4'd3; valid = 1; end\n\t\t\t8'h25: begin out = 4
{"task_id": "vectorr", "llmgen_RTL": ["module top_module (\n\tinput [7:0] in,\n\toutput [7:0] out\n);\n\tassign out = {in[0], in[1], in[2], in[3], in[4], in[5], in[6], in[7]};\nendmodule\n", "module top_module (\n\tinput [7:0] in,\n\toutput [7:0] out\n);\n\tassign out = {in[0], in[1], in[2], in[3], in[4], in[5], in[6], in[7]};\nendmodule\n", "module top_module (\n input [7:0] in,\n output [7:0] out\n);\n assign out = {in[0], in[1], in[2], in[3], in[4], in[5], in[6], in[7]};\nendmodule\n", "module top_module (\n input [7:0] in,\n output [7:0] out\n);\n assign out = {in[0], in[1], in[2], in[3], in[4], in[5], in[6], in[7]};\nendmodule\n", "module top_module (\n input [7:0] in,\n output [7:0] out\n);\n assign out = {in[0], in[1], in[2], in[3], in[4], in[5], in[6], in[7]};\nendmodule\n", "module top_module (\n input [7:0] in,\n output [7:0] out\n);\n\nassign out = {in[0], in[1], in[2], in[3], in[4], in[5], in[6], in[7]};\n\nendmodule\n", "module top_module (\n input [7:0] in,\n output [7:0] out\n);\n assign out = {in[0], in[1], in[2], in[3], in[4], in[5], in[6], in[7]};\nendmodule\n", "module top_module (\n input [7:0] in,\n output [7:0] out\n);\n\nassign out = {in[0], in[1], in[2], in[3], in[4], in[5], in[6], in[7]};\n\nendmodule\n", "module top_module (\n\tinput [7:0] in,\n\toutput [7:0] out\n);\n\tassign out = {in[0], in[1], in[2], in[3], in[4], in[5], in[6], in[7]};\nendmodule\n", "module top_module (\n\tinput [7:0] in,\n\toutput [7:0] out\n);\n\tassign out = {in[0], in[1], in[2], in[3], in[4], in[5], in[6], in[7]};\nendmodule\n", "module top_module (\n\tinput [7:0] in,\n\toutput [7:0] out\n);\n\tassign out = {in[0], in[1], in[2], in[3], in[4], in[5], in[6], in[7]};\nendmodule\n", "module top_module (\n input [7:0] in,\n output [7:0] out\n);\n assign out = {in[0], in[1], in[2], in[3], in[4], in[5], in[6], in[7]};\nendmodule\n", "module top_module (\n input [7:0] in,\n output [7:0] out\n);\n assign out = {in[0], in[1], in[2], in[3], in[4], in[5], in[6], in[7]};\nendmodule\n", "module top_module (\n input [7:0] in,\n output [7:0] out\n);\n assign out = {in[0], in[1], in[2], in[3], in[4], in[5], in[6], in[7]};\nendmodule\n", "module top_module (\n\tinput [7:0] in,\n\toutput [7:0] out\n);\n\tassign out = {in[0], in[1], in[2], in[3], in[4], in[5], in[6], in[7]};\nendmodule\n", "module top_module (\n input [7:0] in,\n output [7:0] out\n);\n assign out = {in[0], in[1], in[2], in[3], in[4], in[5], in[6], in[7]};\nendmodule\n", "module top_module (\n\tinput [7:0] in,\n\toutput [7:0] out\n);\n\tassign out = {in[0], in[1], in[2], in[3], in[4], in[5], in[6], in[7]};\nendmodule\n", "module top_module (\n\tinput [7:0] in,\n\toutput [7:0] out\n);\n\tassign out = {in[0], in[1], in[2], in[3], in[4], in[5], in[6], in[7]};\nendmodule\n", "module top_module (\n\tinput [7:0] in,\n\toutput [7:0] out\n);\n\tassign out = {in[0], in[1], in[2], in[3], in[4], in[5], in[6], in[7]};\nendmodule\n", "module top_module (\n\tinput [7:0] in,\n\toutput [7:0] out\n);\n\tassign out = {in[0], in[1], in[2], in[3], in[4], in[5], in[6], in[7]};\nendmodule\n"]}
{"task_id": "kmap3", "llmgen_RTL": ["module top_module (\n input a, \n input b,\n input c,\n input d,\n output reg out\n);\n\nalways @(*) begin\n case ({c, d, b, a})\n 4'b0000: out = 1'bx; // d\n 4'b0001: out = 1'b0; // 0\n 4'b0010: out = 1'b1; // 1\n 4'b0011: out = 1'b1; // 1\n 4'b0100: out = 1'b0; // 0\n 4'b0101: out = 1'b0; // 0\n 4'b0110: out = 1'bx; // d\n 4'b0111: out = 1'bx; // d\n 4'b1000: out = 1'b0; // 0\n 4'b1001: out = 1'b1; // 1\n 4'b1010: out = 1'b1; // 1\n 4'b1011: out = 1'b1; // 1\n 4'b1100: out = 1'b0; // 0\n 4'b1101: out = 1'b1; // 1\n 4'b1110: out = 1'b1; // 1\n 4'b1111: out = 1'b1; // 1\n default: out = 1'bx; // Don't care\n endcase\nend\n\nendmodule\n", "module top_module (\n input a, \n input b,\n input c,\n input d,\n output reg out\n);\n \n always @(*) begin\n case ({c, d, a, b})\n 4'b0000: out = 1'bx; // d - don't care\n 4'b0001: out = 1'b0; // 0\n 4'b0010: out = 1'b1; // 1\n 4'b0011: out = 1'b1; // 1\n 4'b0100: out = 1'b0; // 0\n 4'b0101: out = 1'b0; // 0\n 4'b0110: out = 1'bx; // d - don't care\n 4'b0111: out = 1'bx; // d - don't care\n 4'b1000: out = 1'b0; // 0\n 4'b1001: out = 1'b1; // 1\n 4'b1010: out = 1'b1; // 1\n 4'b1011: out = 1'b1; // 1\n 4'b1100: out = 1'b0; // 0\n 4'b1101: out = 1'b1; // 1\n 4'b1110: out = 1'b1; // 1\n 4'b1111: out = 1'b1; // 1\n default: out = 1'b0; // default case\n endcase\n end\nendmodule\n", "module top_module (\n input a, \n input b,\n input c,\n input d,\n output reg out\n);\n always @(*) begin\n case({c, d, b, a})\n 4'b0000: out = 1'bx; // d\n 4'b0001: out = 1'b0; // 0\n 4'b0010: out = 1'b1; // 1\n 4'b0011: out = 1'b1; // 1\n 4'b0100: out = 1'b0; // 0\n 4'b0101: out = 1'b0; // 0\n 4'b0110: out = 1'bx; // d\n 4'b0111: out = 1'bx; // d\n 4'b1000: out = 1'b0; // 0\n 4'b1001: out = 1'b1; // 1\n 4'b1010: out = 1'b1; // 1\n 4'b1011: out = 1'b1; // 1\n 4'b1100: out = 1'b0; // 0\n 4'b1101: out = 1'b1; // 1\n 4'b1110: out = 1'b1; // 1\n 4'b1111: out = 1'b1; // 1\n default: out = 1'bx; // undefined\n endcase\n end\nendmodule\n", "module top_module (\n input a, \n input b,\n input c,\n input d,\n output reg out\n);\n\n always @(*) begin\n case ({c, d, b, a})\n 4'b00_01: out = 1; // d -> 0\n 4'b00_00: out = 0; // 0\n 4'b00_10: out = 1; // 1\n 4'b00_11: out = 1; // 1\n 4'b01_01: out = 0; // 0\n 4'b01_00: out = 0; // 0\n 4'b01_10: out = 1; // d -> 1\n 4'b01_11: out = 1; // d -> 1\n 4'b10_01: out = 0; // 0\n 4'b10_00: out = 0; // 0\n 4'b10_10: out = 1; // 1\n 4'b10_11: out = 1; // 1\n 4'b11_01: out = 0; // 0\n 4'b11_00: out = 0; // 0\n 4'b11_10: out = 1; // 1\n 4'b11_11: out = 1; // 1\n default: out = 0;\n endcase\n end\n\nendmodule\n", "module top_module (\n input a, \n input b,\n input c,\n input d,\n output reg out\n);\n always @(*) begin\n case ({a, b, c, d})\n 4'b0000: out = 1'bx; // d (don't care)\n 4'b0001: out = 1'b0;\n 4'b0010: out = 1'b1;\n 4'b0011: out = 1'b1;\n 4'b0100: out = 1'b0;\n 4'b0101: out = 1'b0;\n 4'b0110: out = 1'bx; // d (don't care)\n 4'b0111: out = 1'bx; // d (don't care)\n 4'b1000: out = 1'b0;\n 4'b1001: out = 1'b1;\n 4'b1010: out = 1'b1;\n 4'b1011: out = 1'b1;\n 4'b1100: out = 1'b0;\n
{"task_id": "review2015_shiftcount", "llmgen_RTL": ["module top_module(\n input clk,\n input shift_ena,\n input count_ena,\n input data,\n output reg [3:0] q\n);\n\n always @(posedge clk) begin\n if (shift_ena) begin\n q <= {data, q[3:1]}; // Shift in data, shift the rest\n end else if (count_ena) begin\n q <= q - 1; // Decrement the value in the shift register\n end\n end\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput shift_ena,\n\tinput count_ena,\n\tinput data,\n\toutput reg [3:0] q\n);\n\n\talways @(posedge clk) begin\n\t\tif (shift_ena) begin\n\t\t\tq <= {data, q[3:1]};\n\t\tend else if (count_ena) begin\n\t\t\tq <= q - 1;\n\t\tend\n\tend\n\nendmodule\n", "module top_module(\n input clk,\n input shift_ena,\n input count_ena,\n input data,\n output reg [3:0] q\n);\n always @(posedge clk) begin\n if (shift_ena) begin\n q <= {data, q[3:1]}; // Shift in data at MSB\n end else if (count_ena) begin\n q <= q - 1; // Decrement the register\n end\n end\nendmodule\n", "module top_module(\n input clk,\n input shift_ena,\n input count_ena,\n input data,\n output reg [3:0] q\n);\n always @(posedge clk) begin\n if (shift_ena) begin\n q <= {data, q[3:1]}; // Shift in data at MSB\n end else if (count_ena) begin\n q <= q - 1; // Decrement the value\n end\n end\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput shift_ena,\n\tinput count_ena,\n\tinput data,\n\toutput reg [3:0] q\n);\n\nalways @(posedge clk) begin\n\tif (shift_ena) begin\n\t\tq <= {data, q[3:1]}; // Shift in data, MSB first\n\tend else if (count_ena) begin\n\t\tq <= q - 1; // Decrement the counter\n\tend\nend\n\nendmodule\n", "module top_module(\n input clk,\n input shift_ena,\n input count_ena,\n input data,\n output reg [3:0] q\n);\n\n always @(posedge clk) begin\n if (shift_ena) begin\n q <= {data, q[3:1]}; // Shift in data MSB first\n end else if (count_ena) begin\n q <= q - 1; // Decrement the value in the shift register\n end\n end\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput shift_ena,\n\tinput count_ena,\n\tinput data,\n\toutput reg [3:0] q);\n\n\talways @(posedge clk) begin\n\t\tif (shift_ena) begin\n\t\t\tq <= {data, q[3:1]};\n\t\tend else if (count_ena) begin\n\t\t\tq <= q - 1;\n\t\tend\n\tend\nendmodule\n", "module top_module(\n input clk,\n input shift_ena,\n input count_ena,\n input data,\n output reg [3:0] q);\n\n always @(posedge clk) begin\n if (shift_ena) begin\n q <= {data, q[3:1]};\n end else if (count_ena) begin\n q <= q - 1;\n end\n end\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput shift_ena,\n\tinput count_ena,\n\tinput data,\n\toutput reg [3:0] q\n);\n\n\talways @(posedge clk) begin\n\t\tif (shift_ena) begin\n\t\t\tq <= {data, q[3:1]}; // Shift in from MSB\n\t\tend else if (count_ena) begin\n\t\t\tq <= q - 1; // Decrement the value\n\t\tend\n\tend\n\nendmodule\n", "module top_module(\n input clk,\n input shift_ena,\n input count_ena,\n input data,\n output reg [3:0] q\n);\n \n always @(posedge clk) begin\n if (shift_ena) begin\n q <= {data, q[3:1]};\n end else if (count_ena) begin\n q <= q - 1;\n end\n end\n \nendmodule\n", "module top_module(\n\tinput clk,\n\tinput shift_ena,\n\tinput count_ena,\n\tinput data,\n\toutput reg [3:0] q);\n\n\talways @(posedge clk) begin\n\t\tif (shift_ena) begin\n\t\t\tq <= {data, q[3:1]};\n\t\tend else if (count_ena) begin\n\t\t\tq <= q - 1;\n\t\tend\n\tend\nendmodule\n", "module top_module(\n input clk,\n input shift_ena,\n input count_ena,\n input data,\n output reg [3:0] q\n);\n \n always @(posedge clk) begin\n if (shift_ena) begin\n q <= {data, q[3:1]}; // Shift in data MSB first\n end else if (count_ena) begin\n q <= q - 1;
{"task_id": "wire", "llmgen_RTL": ["module top_module(\n input in,\n output out\n);\n assign out = in;\nendmodule\n", "module top_module(\n input in,\n output out\n);\n assign out = in;\nendmodule\n", "module top_module(\n input in,\n output out\n);\n assign out = in;\nendmodule\n", "module top_module(\n\tinput in,\n\toutput out);\n\t\n\tassign out = in;\n\nendmodule\n", "module top_module(\n\tinput in,\n\toutput out);\n\t\n\tassign out = in;\n\nendmodule\n", "module top_module(\n\tinput in,\n\toutput out);\n\n\tassign out = in;\n\nendmodule\n", "module top_module(\n\tinput in,\n\toutput out);\n\tassign out = in;\nendmodule\n", "module top_module(\n\tinput in,\n\toutput out);\n\t\n\tassign out = in;\n\nendmodule\n", "module top_module(\n input in,\n output out\n);\n assign out = in;\nendmodule\n", "module top_module(\n\tinput in,\n\toutput out);\n\tassign out = in;\nendmodule\n", "module top_module(\n\tinput in,\n\toutput out\n);\n\tassign out = in;\nendmodule\n", "module top_module(\n\tinput in,\n\toutput out);\n\t\n\tassign out = in;\n\nendmodule\n", "module top_module(\n\tinput in,\n\toutput out\n);\n\tassign out = in;\nendmodule\n", "module top_module(\n\tinput in,\n\toutput out);\n\n\tassign out = in;\n\nendmodule\n", "module top_module(\n input in,\n output out\n);\n assign out = in;\nendmodule\n", "module top_module(\n input in,\n output out\n);\n assign out = in;\nendmodule\n", "module top_module(\n input in,\n output out\n);\n assign out = in;\nendmodule\n", "module top_module(\n\tinput in,\n\toutput out\n);\n\tassign out = in;\nendmodule\n", "module top_module(\n input in,\n output out);\n\n assign out = in;\n\nendmodule\n", "module top_module(\n\tinput in,\n\toutput out);\n\tassign out = in;\nendmodule\n"]}
{"task_id": "review2015_fsmshift", "llmgen_RTL": ["module top_module(\n input clk,\n input reset,\n output reg shift_ena\n);\n\n reg [2:0] count;\n reg fsm_state;\n\n always @(posedge clk) begin\n if (reset) begin\n count <= 3'b000;\n shift_ena <= 1'b1;\n fsm_state <= 1'b1; // Indicating that we are in the shift enable state\n end else begin\n if (fsm_state) begin\n if (count < 3'b011) begin\n count <= count + 1;\n shift_ena <= 1'b1; // Assert shift_ena\n end else begin\n count <= 3'b000;\n shift_ena <= 1'b0; // De-assert shift_ena after 4 cycles\n fsm_state <= 1'b0; // Move to shift disable state\n end\n end\n end\n end\n\nendmodule\n", "module top_module(\n input clk,\n input reset,\n output reg shift_ena\n);\n reg [1:0] count;\n\n always @(posedge clk) begin\n if (reset) begin\n count <= 2'b00;\n shift_ena <= 1'b1;\n end else if (count < 2'b11) begin\n count <= count + 1;\n shift_ena <= 1'b1;\n end else begin\n shift_ena <= 1'b0;\n end\n end\nendmodule\n", "module top_module(\n input clk,\n input reset,\n output reg shift_ena\n);\n\nreg [1:0] count;\n\nalways @(posedge clk) begin\n if (reset) begin\n shift_ena <= 1'b1;\n count <= 2'b00;\n end else if (count < 2'b11) begin\n count <= count + 1;\n end else begin\n shift_ena <= 1'b0;\n end\nend\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput reset,\n\toutput reg shift_ena);\n\n\treg [1:0] count;\n\n\talways @(posedge clk) begin\n\t\tif (reset) begin\n\t\t\tshift_ena <= 1;\n\t\t\tcount <= 2'b00;\n\t\tend else if (count < 2'b11) begin\n\t\t\tcount <= count + 1'b1;\n\t\t\tshift_ena <= 1;\n\t\tend else begin\n\t\t\tshift_ena <= 0;\n\t\tend\n\tend\nendmodule\n", "module top_module(\n input clk,\n input reset,\n output reg shift_ena\n);\n\nreg [2:0] count; // 3-bit counter to track 4 cycles\n\nalways @(posedge clk) begin\n if (reset) begin\n shift_ena <= 1'b1; // Enable shift register\n count <= 3'b000; // Reset count\n end else if (count < 3'd4) begin\n count <= count + 1; // Increment count\n shift_ena <= 1'b1; // Keep shift enable high\n end else begin\n shift_ena <= 1'b0; // Disable shift after 4 cycles\n end\nend\n\nendmodule\n", "module top_module(\n input clk,\n input reset,\n output reg shift_ena\n);\n reg [2:0] count;\n\n always @(posedge clk) begin\n if (reset) begin\n count <= 3'b000;\n shift_ena <= 1'b1;\n end else if (count < 3'b100) begin\n count <= count + 1;\n shift_ena <= 1'b1;\n end else begin\n shift_ena <= 1'b0;\n end\n end\nendmodule\n", "module top_module(\n input clk,\n input reset,\n output reg shift_ena\n);\n\n reg [2:0] count;\n\n always @(posedge clk) begin\n if (reset) begin\n count <= 3'b000;\n shift_ena <= 1'b1;\n end else if (count < 3'b100) begin\n count <= count + 1;\n shift_ena <= 1'b1;\n end else begin\n shift_ena <= 1'b0;\n end\n end\n\nendmodule\n", "module top_module(\n input clk,\n input reset,\n output reg shift_ena\n);\n\nreg [1:0] count;\n\nalways @(posedge clk) begin\n if (reset) begin\n shift_ena <= 1'b1;\n count <= 2'b00;\n end else if (count < 2'b11) begin\n count <= count + 1;\n end else begin\n shift_ena <= 1'b0;\n end\nend\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput reset,\n\toutput reg shift_ena\n);\n \n\treg [2:0] count; // 3 bits to count from 0 to 4\n\n\talways @(posedge clk) begin\n\t\tif (reset) begin\n\t\t\tcount <= 3'd0;\n\t\t\tshift_ena <= 1'b1; // Assert shift_ena on reset\n\t\tend else if (count < 3'd4
{"task_id": "count15", "llmgen_RTL": ["module top_module(\n\tinput clk,\n\tinput reset,\n\toutput reg [3:0] q);\n\nalways @(posedge clk) begin\n\tif (reset) begin\n\t\tq <= 4'b0000;\n\tend else begin\n\t\tq <= q + 1;\n\tend\nend\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput reset,\n\toutput reg [3:0] q);\n\n\talways @(posedge clk) begin\n\t\tif (reset) begin\n\t\t\tq <= 4'b0000;\n\t\tend else begin\n\t\t\tq <= q + 1;\n\t\tend\n\tend\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput reset,\n\toutput reg [3:0] q);\n\n\talways @(posedge clk) begin\n\t\tif (reset) begin\n\t\t\tq <= 4'b0000;\n\t\tend else begin\n\t\t\tq <= q + 1;\n\t\tend\n\tend\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput reset,\n\toutput reg [3:0] q);\n\n\talways @(posedge clk) begin\n\t\tif (reset) begin\n\t\t\tq <= 4'b0000;\n\t\tend else begin\n\t\t\tq <= q + 1;\n\t\tend\n\tend\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput reset,\n\toutput reg [3:0] q\n);\n\talways @(posedge clk) begin\n\t\tif (reset) begin\n\t\t\tq <= 4'b0000;\n\t\tend else begin\n\t\t\tq <= q + 1;\n\t\tend\n\tend\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput reset,\n\toutput reg [3:0] q);\n\n\talways @(posedge clk) begin\n\t\tif (reset) begin\n\t\t\tq <= 4'b0000;\n\t\tend else begin\n\t\t\tq <= q + 1;\n\t\tend\n\tend\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput reset,\n\toutput reg [3:0] q);\n\n\talways @(posedge clk) begin\n\t\tif (reset) begin\n\t\t\tq <= 4'b0000;\n\t\tend else begin\n\t\t\tq <= q + 1;\n\t\tend\n\tend\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput reset,\n\toutput reg [3:0] q);\n\n\talways @(posedge clk) begin\n\t\tif (reset) begin\n\t\t\tq <= 4'b0000;\n\t\tend else begin\n\t\t\tq <= q + 1;\n\t\tend\n\tend\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput reset,\n\toutput reg [3:0] q);\n\n\talways @(posedge clk) begin\n\t\tif (reset) begin\n\t\t\tq <= 4'b0000;\n\t\tend else begin\n\t\t\tq <= q + 1;\n\t\tend\n\tend\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput reset,\n\toutput reg [3:0] q);\n\n\talways @(posedge clk) begin\n\t\tif (reset) begin\n\t\t\tq <= 4'b0000;\n\t\tend else begin\n\t\t\tq <= q + 1;\n\t\tend\n\tend\nendmodule\n", "module top_module(\n input clk,\n input reset,\n output reg [3:0] q);\n\n always @(posedge clk) begin\n if (reset) begin\n q <= 4'b0000;\n end else begin\n q <= q + 1;\n end\n end\nendmodule\n", "module top_module(\n input clk,\n input reset,\n output reg [3:0] q);\n\n always @(posedge clk) begin\n if (reset) begin\n q <= 4'b0000;\n end else begin\n q <= q + 1;\n end\n end\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput reset,\n\toutput reg [3:0] q);\n\n\talways @(posedge clk) begin\n\t\tif (reset) begin\n\t\t\tq <= 4'b0000;\n\t\tend else begin\n\t\t\tq <= q + 1'b1;\n\t\tend\n\tend\nendmodule\n", "module top_module(\n input clk,\n input reset,\n output reg [3:0] q);\n\n always @(posedge clk) begin\n if (reset) \n q <= 4'b0000;\n else \n q <= q + 1;\n end\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput reset,\n\toutput reg [3:0] q);\n\n\talways @(posedge clk) begin\n\t\tif (reset) \n\t\t\tq <= 4'b0000; \n\t\telse \n\t\t\tq <= q + 1;\n\tend\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput reset,\n\toutput reg [3:0] q);\n\n\talways @(posedge clk) begin\n\t\tif (reset) begin\n\t\t\tq <= 4'b0000;\n\t\tend else begin\n\t\t\tq <= q + 1;\n\t\tend\n\tend\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput reset,\n\toutput reg [3:0] q);\n\t\n\talways @(posedge clk) begin\n\t\tif (reset) begin\n\t\t\tq <= 4'b0000;\n\t\tend else begin\n\t\t\tq <= q + 1;\n\t\tend\n\tend\n\t\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput reset,\n\toutput reg [3:0] q);\n\n\talways @(posedge clk) begin\n\t\tif (reset) begin\n\t\t\tq <= 4'b0000;\n\t\tend else begin\n\t\t\tq <= q + 1;\n\t\tend\n\tend\nendmodule\n", "module top_module(\n\tinput clk,\n
{"task_id": "always_if", "llmgen_RTL": ["module top_module (\n input a,\n input b,\n input sel_b1,\n input sel_b2,\n output out_assign,\n output reg out_always\n);\n\n// Assign statement implementation\nassign out_assign = (sel_b1 && sel_b2) ? b : a;\n\n// Procedural if statement implementation\nalways @(*) begin\n if (sel_b1 && sel_b2) \n out_always = b;\n else \n out_always = a;\nend\n\nendmodule\n", "module top_module (\n input a,\n input b,\n input sel_b1,\n input sel_b2,\n output out_assign,\n output reg out_always\n);\n\n // Using assign statements\n assign out_assign = (sel_b1 && sel_b2) ? b : a;\n\n // Using procedural if statement\n always @* begin\n if (sel_b1 && sel_b2) begin\n out_always = b;\n end else begin\n out_always = a;\n end\n end\n\nendmodule\n", "module top_module (\n\tinput a,\n\tinput b,\n\tinput sel_b1,\n\tinput sel_b2,\n\toutput out_assign,\n\toutput reg out_always\n);\n\n// Assign statement for output\nassign out_assign = (sel_b1 & sel_b2) ? b : a;\n\n// Procedural if statement for output\nalways @* begin\n\tif (sel_b1 && sel_b2) \n\t\tout_always = b;\n\telse \n\t\tout_always = a;\nend\n\nendmodule\n", "module top_module (\n\tinput a,\n\tinput b,\n\tinput sel_b1,\n\tinput sel_b2,\n\toutput out_assign,\n\toutput reg out_always\n);\n\nassign out_assign = (sel_b1 && sel_b2) ? b : a;\n\nalways @(*) begin\n\tif (sel_b1 && sel_b2) \n\t\tout_always = b; \n\telse \n\t\tout_always = a; \nend\n\nendmodule\n", "module top_module (\n input a,\n input b,\n input sel_b1,\n input sel_b2,\n output out_assign,\n output reg out_always\n);\n\nassign out_assign = (sel_b1 && sel_b2) ? b : a;\n\nalways @(*) begin\n if (sel_b1 && sel_b2)\n out_always = b;\n else\n out_always = a;\nend\n\nendmodule\n", "module top_module (\n input a,\n input b,\n input sel_b1,\n input sel_b2,\n output out_assign,\n output reg out_always\n);\n\n // Mux using assign statements\n assign out_assign = (sel_b1 && sel_b2) ? b : a;\n\n // Mux using procedural if statement\n always @(*) begin\n if (sel_b1 && sel_b2) \n out_always = b;\n else \n out_always = a;\n end\n\nendmodule\n", "module top_module (\n\tinput a,\n\tinput b,\n\tinput sel_b1,\n\tinput sel_b2,\n\toutput out_assign,\n\toutput reg out_always\n);\n\nassign out_assign = (sel_b1 && sel_b2) ? b : a;\n\nalways @* begin\n\tif (sel_b1 && sel_b2) \n\t\tout_always = b;\n\telse \n\t\tout_always = a;\nend\n\nendmodule\n", "module top_module (\n input a,\n input b,\n input sel_b1,\n input sel_b2,\n output out_assign,\n output reg out_always\n);\n\n // Using assign statement for mux behavior\n assign out_assign = (sel_b1 && sel_b2) ? b : a;\n\n // Using procedural if statement for mux behavior\n always @(*) begin\n if (sel_b1 && sel_b2) \n out_always = b;\n else \n out_always = a;\n end\n\nendmodule\n", "module top_module (\n input a,\n input b,\n input sel_b1,\n input sel_b2,\n output out_assign,\n output reg out_always\n);\n\n // Using assign statement\n assign out_assign = (sel_b1 && sel_b2) ? b : a;\n\n // Using procedural if statement\n always @(*) begin\n if (sel_b1 && sel_b2) \n out_always = b;\n else \n out_always = a;\n end\n\nendmodule\n", "module top_module (\n\tinput a,\n\tinput b,\n\tinput sel_b1,\n\tinput sel_b2,\n\toutput out_assign,\n\toutput reg out_always\n);\n\nassign out_assign = (sel_b1 && sel_b2) ? b : a;\n\nalways @(*) begin\n\tif (sel_b1 && sel_b2) \n\t\tout_always = b;\n\telse \n\t\tout_always = a;\nend\n\nendmodule\n", "module top_module (\n input a,\n input b,\n input sel_b1,\n input sel_b2,\n output out_assign,\n output reg out_always\n);\n\n // Using assign statements\n assign out_assign = (sel_b1 && sel_b2) ? b : a;\n\n // Using procedural if statement\n always @(*) begin\n
{"task_id": "kmap1", "llmgen_RTL": ["module top_module(\n\tinput a, \n\tinput b,\n\tinput c,\n\toutput out\n);\n\tassign out = (b == 1'b0 && c == 1'b1) || (b == 1'b1) || (b == 1'b0 && c == 1'b0 && a == 1'b1);\nendmodule\n", "module top_module(\n\tinput a, \n\tinput b,\n\tinput c,\n\toutput out\n);\n\tassign out = (b & ~c) | (a & ~b) | (a & b);\nendmodule\n", "module top_module(\n\tinput a, \n\tinput b,\n\tinput c,\n\toutput out\n);\nassign out = (b & c) | (b & ~a) | (~b & ~c) | (a & b);\nendmodule\n", "module top_module(\n input a, \n input b,\n input c,\n output out\n);\n assign out = (b == 0 && c == 1) || (b == 1 && (c == 0 || c == 1)) || (b == 1 && a == 1);\nendmodule\n", "module top_module(\n input a, \n input b,\n input c,\n output out\n);\n\nassign out = (b & ~c) | (b & a) | (a & c) | (~b & c);\n\nendmodule\n", "module top_module(\n input a, \n input b,\n input c,\n output out\n);\n assign out = (b == 1'b0 && c == 1'b0 && a) || (b == 1'b0 && c == 1'b1) || \n (b == 1'b1 && c == 1'b0) || (b == 1'b1 && c == 1'b1) || \n (b == 1'b0 && c == 1'b1) || (b == 1'b1 && c == 1'b1);\nendmodule\n", "module top_module(\n\tinput a, \n\tinput b,\n\tinput c,\n\toutput out\n);\n\tassign out = (b & ~c) | (a & b) | (a & c) | (~a & b & c);\nendmodule\n", "module top_module(\n\tinput a, \n\tinput b,\n\tinput c,\n\toutput out\n);\n\tassign out = (b & c) | (b & ~a) | (c & ~a) | (c & b);\nendmodule\n", "module top_module(\n input a, \n input b,\n input c,\n output out\n);\n assign out = (b & ~c) | (a & (b | c)) | (~a & (b | ~c));\nendmodule\n", "module top_module(\n input a, \n input b,\n input c,\n output out\n);\n assign out = (b == 1'b0 && c == 1'b1) || (b == 1'b1) || (b == 1'b0 && c == 1'b0 && a == 1'b1);\nendmodule\n", "module top_module(\n input a, \n input b,\n input c,\n output out\n);\n assign out = (b & ~c) | (b & a) | (~b & a) | (a & c);\nendmodule\n", "module top_module(\n input a, \n input b,\n input c,\n output out\n);\n assign out = (b & ~c) | (a & ~b) | (a & c) | (b & c);\nendmodule\n", "module top_module(\n input a, \n input b,\n input c,\n output out\n);\n assign out = (b == 1'b0 && c == 1'b1) || (b == 1'b1) || (b == 1'b0 && c == 1'b0 && a == 1'b1);\nendmodule\n", "module top_module(\n\tinput a, \n\tinput b,\n\tinput c,\n\toutput out\n);\n assign out = (b & ~c) | (a & b) | (a & ~b) | (a & c);\nendmodule\n", "module top_module(\n input a, \n input b,\n input c,\n output out\n);\n assign out = (b & c) | (a & (b | c));\nendmodule\n", "module top_module(\n input a, \n input b,\n input c,\n output out\n);\n assign out = (b & c) | (b & ~a) | (c & ~a);\nendmodule\n", "module top_module(\n input a, \n input b,\n input c,\n output out\n);\n assign out = (b & c) | (a & b) | (a & c) | (b & ~c);\nendmodule\n", "module top_module(\n\tinput a, \n\tinput b,\n\tinput c,\n\toutput out\n);\n\tassign out = (b & ~c) | (b & a) | (c & a) | (b & c) | (~b & ~a & c);\nendmodule\n", "module top_module(\n\tinput a, \n\tinput b,\n\tinput c,\n\toutput out\n);\n\tassign out = (b & ~c) | (a & (b | c));\nendmodule\n", "module top_module(\n\tinput a, \n\tinput b,\n\tinput c,\n\toutput out\n);\n assign out = (b & c) | (b & ~a) | (~b & a) | (~c & a);\nendmodule\n"]}
{"task_id": "2013_q2afsm", "llmgen_RTL": ["module top_module (\n input clk,\n input resetn,\n input [3:1] r,\n output reg [3:1] g\n);\n typedef enum reg [1:0] {\n A = 2'b00,\n B = 2'b01,\n C = 2'b10\n } state_t;\n\n state_t current_state, next_state;\n\n always_ff @(posedge clk or negedge resetn) begin\n if (!resetn)\n current_state <= A;\n else\n current_state <= next_state;\n end\n\n always_ff @(current_state, r) begin\n case (current_state)\n A: begin\n if (r[1]) next_state = B; // Move to B if r1 is high\n else if (r[2]) next_state = C; // Move to C if r2 is high\n else if (r[3]) next_state = D; // Move to D if r3 is high\n else next_state = A; // Stay in A otherwise\n end\n B: begin\n if (r[1]) next_state = B; // Stay in B if r1 is high\n else next_state = A; // Return to A if r1 is low\n end\n C: begin\n if (r[2]) next_state = C; // Stay in C if r2 is high\n else next_state = A; // Return to A if r2 is low\n end\n default: next_state = A; // Default case\n endcase\n end\n\n always_ff @(current_state) begin\n g = 3'b000; // Default to no grants\n case (current_state)\n B: g[1] = 1; // Grant for device 1\n C: g[2] = 1; // Grant for device 2\n // Device 3 can be granted in state D, but logic to handle that can be added if needed\n endcase\n end\nendmodule\n", "module top_module (\n input clk,\n input resetn,\n input [3:1] r,\n output reg [3:1] g\n);\n\n typedef enum logic [1:0] {\n A = 2'b00,\n B = 2'b01,\n C = 2'b10,\n D = 2'b11\n } state_t;\n\n state_t current_state, next_state;\n\n // State flip-flops\n always_ff @(posedge clk or negedge resetn) begin\n if (!resetn)\n current_state <= A;\n else\n current_state <= next_state;\n end\n\n // State transition logic\n always_comb begin\n case (current_state)\n A: begin\n if (r[1]) next_state = B;\n else if (r[2]) next_state = C;\n else if (r[3]) next_state = D;\n else next_state = A;\n end\n B: begin\n if (r[1]) next_state = B; // g1 = 1\n else next_state = A; // return to A if r1 = 0\n end\n C: begin\n if (r[2]) next_state = C; // g2 = 1\n else next_state = A; // return to A if r2 = 0\n end\n D: begin\n next_state = A; // return to A from D\n end\n default: next_state = A; // safety default\n endcase\n end\n\n // Output logic\n always_ff @(current_state) begin\n g = 3'b000; // default to zero\n case (current_state)\n B: g[1] = 1; // Grant to device 1\n C: g[2] = 1; // Grant to device 2\n D: g[3] = 1; // Grant to device 3\n default: g = 3'b000;\n endcase\n end\n\nendmodule\n", "module top_module (\n input clk,\n input resetn,\n input [3:1] r,\n output reg [3:1] g\n);\n\n // State encoding\n typedef enum reg [1:0] {\n A = 2'b00,\n B = 2'b01,\n C = 2'b10,\n D = 2'b11\n } state_t;\n\n state_t current_state, next_state;\n\n // State flip-flops\n always @(posedge clk or negedge resetn) begin\n if (!resetn)\n current_state <= A;\n else\n current_state <= next_state;\n end\n\n // Next state logic\n always @(*) begin\n case (current_state)\n A: begin\n if (r[1])\n next_state = B;\n else if (r[2])\n next_state = C;\n
{"task_id": "count10", "llmgen_RTL": ["module top_module(\n\tinput clk,\n\tinput reset,\n\toutput reg [3:0] q);\n\n\talways @(posedge clk) begin\n\t\tif (reset) begin\n\t\t\tq <= 4'b0000;\n\t\tend else begin\n\t\t\tif (q == 4'b1001) begin\n\t\t\t\tq <= 4'b0000; // Reset to 0 after counting to 9\n\t\t\tend else begin\n\t\t\t\tq <= q + 1; // Increment the counter\n\t\t\tend\n\t\tend\n\tend\nendmodule\n", "module top_module(\n input clk,\n input reset,\n output reg [3:0] q);\n\n always @(posedge clk) begin\n if (reset) begin\n q <= 4'b0000;\n end else if (q == 4'b1001) begin\n q <= 4'b0000;\n end else begin\n q <= q + 1;\n end\n end\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput reset,\n\toutput reg [3:0] q);\n\n\talways @(posedge clk) begin\n\t\tif (reset) begin\n\t\t\tq <= 4'b0000;\n\t\tend else if (q == 4'b1001) begin\n\t\t\tq <= 4'b0000;\n\t\tend else begin\n\t\t\tq <= q + 1;\n\t\tend\n\tend\n\nendmodule\n", "module top_module(\n input clk,\n input reset,\n output reg [3:0] q);\n\n always @(posedge clk) begin\n if (reset) begin\n q <= 4'b0000;\n end else if (q == 4'b1001) begin\n q <= 4'b0000;\n end else begin\n q <= q + 1;\n end\n end\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput reset,\n\toutput reg [3:0] q);\n\n\talways @(posedge clk) begin\n\t\tif (reset) begin\n\t\t\tq <= 0;\n\t\tend else begin\n\t\t\tif (q == 9) begin\n\t\t\t\tq <= 0;\n\t\t\tend else begin\n\t\t\t\tq <= q + 1;\n\t\t\tend\n\t\tend\n\tend\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput reset,\n\toutput reg [3:0] q);\n\t\n\talways @(posedge clk) begin\n\t\tif (reset) begin\n\t\t\tq <= 4'b0000;\n\t\tend else if (q == 4'b1001) begin\n\t\t\tq <= 4'b0000;\n\t\tend else begin\n\t\t\tq <= q + 1;\n\t\tend\n\tend\n\t\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput reset,\n\toutput reg [3:0] q);\n\n\talways @(posedge clk) begin\n\t\tif (reset) begin\n\t\t\tq <= 4'b0000;\n\t\tend else if (q == 4'b1001) begin\n\t\t\tq <= 4'b0000;\n\t\tend else begin\n\t\t\tq <= q + 1;\n\t\tend\n\tend\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput reset,\n\toutput reg [3:0] q);\n\n\talways @(posedge clk) begin\n\t\tif (reset) begin\n\t\t\tq <= 4'b0000; // Reset counter to 0\n\t\tend else if (q == 4'b1001) begin\n\t\t\tq <= 4'b0000; // Reset to 0 after counting to 9\n\t\tend else begin\n\t\t\tq <= q + 1; // Increment counter\n\t\tend\n\tend\nendmodule\n", "module top_module(\n input clk,\n input reset,\n output reg [3:0] q\n);\n always @(posedge clk) begin\n if (reset) begin\n q <= 4'b0000;\n end else if (q == 4'b1001) begin\n q <= 4'b0000;\n end else begin\n q <= q + 1;\n end\n end\nendmodule\n", "module top_module(\n input clk,\n input reset,\n output reg [3:0] q\n);\n always @(posedge clk) begin\n if (reset) begin\n q <= 4'b0000;\n end else if (q == 4'b1001) begin\n q <= 4'b0000;\n end else begin\n q <= q + 1;\n end\n end\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput reset,\n\toutput reg [3:0] q);\n\nalways @(posedge clk) begin\n\tif (reset) begin\n\t\tq <= 4'b0000;\n\tend else if (q == 4'b1001) begin\n\t\tq <= 4'b0000;\n\tend else begin\n\t\tq <= q + 1;\n\tend\nend\n\nendmodule\n", "module top_module(\n input clk,\n input reset,\n output reg [3:0] q\n);\n always @(posedge clk) begin\n if (reset) begin\n q <= 4'b0000;\n end else if (q == 4'b1001) begin\n q <= 4'b0000;\n end else begin\n q <= q + 1'b1;\n end\n end\nendmodule\n", "module top_module(\n input clk,\n input reset,\n output reg [3:0] q);\n\n always @(posedge clk) begin\n if (reset) begin\n q <= 4'b0000;\n end else if (q == 4'b1001) begin\n q <= 4'b0000;\n end else begin\n q <= q + 1;\n end\n end\nend
{"task_id": "fsm_ps2", "llmgen_RTL": ["module top_module (\n\tinput clk,\n\tinput [7:0] in,\n\tinput reset,\n\toutput reg done\n);\n\n\treg [1:0] state; // 2-bit state register\n\tlocalparam IDLE = 2'b00, BYTE1 = 2'b01, BYTE2 = 2'b10, BYTE3 = 2'b11;\n\n\talways @(posedge clk) begin\n\t\tif (reset) begin\n\t\t\tstate <= IDLE;\n\t\t\tdone <= 0;\n\t\tend else begin\n\t\t\tcase (state)\n\t\t\t\tIDLE: begin\n\t\t\t\t\tif (in[3] == 1) begin\n\t\t\t\t\t\tstate <= BYTE1;\n\t\t\t\t\t\tdone <= 0;\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\t\tBYTE1: begin\n\t\t\t\t\tstate <= BYTE2; // Move to the next state regardless of in[3]\n\t\t\t\tend\n\t\t\t\tBYTE2: begin\n\t\t\t\t\tstate <= BYTE3; // Move to the next state regardless of in[3]\n\t\t\t\tend\n\t\t\t\tBYTE3: begin\n\t\t\t\t\tif (in[3] == 1) begin\n\t\t\t\t\t\tdone <= 1; // Signal done\n\t\t\t\t\tend\n\t\t\t\t\tstate <= IDLE; // Prepare for the next message\n\t\t\t\tend\n\t\t\tendcase\n\t\tend\n\tend\n\nendmodule\n", "module top_module (\n input clk,\n input [7:0] in,\n input reset,\n output reg done\n);\n\n reg [1:0] state;\n localparam IDLE = 2'b00, RECEIVING = 2'b01, COMPLETE = 2'b10;\n\n always @(posedge clk) begin\n if (reset) begin\n state <= IDLE;\n done <= 0;\n end else begin\n case (state)\n IDLE: begin\n done <= 0;\n if (in[3] == 1) begin\n state <= RECEIVING;\n end\n end\n RECEIVING: begin\n if (in[3] == 1) begin\n state <= COMPLETE;\n end\n end\n COMPLETE: begin\n done <= 1;\n state <= IDLE;\n end\n endcase\n end\n end\n\nendmodule\n", "module top_module (\n input clk,\n input [7:0] in,\n input reset,\n output reg done\n);\n\n typedef enum logic [1:0] {\n IDLE,\n BYTE1,\n BYTE2,\n BYTE3\n } state_t;\n\n state_t current_state, next_state;\n integer byte_count;\n\n always_ff @(posedge clk) begin\n if (reset) begin\n current_state <= IDLE;\n done <= 0;\n byte_count <= 0;\n end else begin\n current_state <= next_state;\n if (current_state == BYTE3) begin\n done <= 1;\n end else begin\n done <= 0;\n end\n end\n end\n\n always_comb begin\n next_state = current_state;\n case (current_state)\n IDLE: begin\n if (in[3] == 1) begin\n byte_count = 1;\n next_state = BYTE1;\n end\n end\n BYTE1: begin\n byte_count = 2;\n next_state = BYTE2;\n end\n BYTE2: begin\n byte_count = 3;\n next_state = BYTE3;\n end\n BYTE3: begin\n byte_count = 0; // Reset for the next message\n next_state = IDLE;\n end\n default: next_state = IDLE;\n endcase\n end\n\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput [7:0] in,\n\tinput reset,\n\toutput reg done\n);\n\n\treg [1:0] state;\n\tlocalparam IDLE = 2'b00, WAIT_FOR_BYTE1 = 2'b01, WAIT_FOR_BYTE2 = 2'b10, WAIT_FOR_BYTE3 = 2'b11;\n\n\talways @(posedge clk) begin\n\t\tif (reset) begin\n\t\t\tstate <= IDLE;\n\t\t\tdone <= 0;\n\t\tend else begin\n\t\t\tcase (state)\n\t\t\t\tIDLE: begin\n\t\t\t\t\tif (in[3] == 1) begin\n\t\t\t\t\t\tstate <= WAIT_FOR_BYTE1;\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\t\tWAIT_FOR_BYTE1: begin\n\t\t\t\t\tstate <= WAIT_FOR_BYTE2;\n\t\t\t\tend\n\t\t\t\tWAIT_FOR_BYTE2: begin\n\t\t\t\t\tstate <= WAIT_FOR_BYTE3;\n\t\t\t\tend\n\t\t\t\tWAIT_FOR_BYTE3: begin\n\t\t\t\t\tdone <= 1;\n\t\t\t\t\tstate <= IDLE;\n\t\t\t\tend\n\t\t\tendcase\n\t\tend\n\tend\n\n\talways @(negedge clk) begin\n\t\tif (state == WAIT_FOR_BYTE3) begin\n\t\t\tdone
{"task_id": "mux2to1", "llmgen_RTL": ["module top_module (\n input a,\n input b,\n input sel,\n output out\n);\n assign out = sel ? b : a;\nendmodule\n", "module top_module (\n input a,\n input b,\n input sel,\n output out\n);\n assign out = sel ? b : a;\nendmodule\n", "module top_module (\n input a,\n input b,\n input sel,\n output out\n);\n assign out = sel ? b : a;\nendmodule\n", "module top_module (\n\tinput a,\n\tinput b,\n\tinput sel,\n\toutput out\n);\n\tassign out = sel ? b : a;\nendmodule\n", "module top_module (\n input a,\n input b,\n input sel,\n output out\n);\n assign out = sel ? b : a;\nendmodule\n", "module top_module (\n\tinput a,\n\tinput b,\n\tinput sel,\n\toutput out\n);\n\tassign out = sel ? b : a;\nendmodule\n", "module top_module (\n\tinput a,\n\tinput b,\n\tinput sel,\n\toutput out\n);\n\tassign out = sel ? b : a;\nendmodule\n", "module top_module (\n\tinput a,\n\tinput b,\n\tinput sel,\n\toutput out\n);\n\tassign out = (sel == 0) ? a : b;\nendmodule\n", "module top_module (\n input a,\n input b,\n input sel,\n output out\n);\n assign out = sel ? b : a;\nendmodule\n", "module top_module (\n input a,\n input b,\n input sel,\n output out\n);\n assign out = sel ? b : a;\nendmodule\n", "module top_module (\n input a,\n input b,\n input sel,\n output out\n);\n assign out = (sel) ? b : a;\nendmodule\n", "module top_module (\n\tinput a,\n\tinput b,\n\tinput sel,\n\toutput out\n);\n\tassign out = sel ? b : a;\nendmodule\n", "module top_module (\n\tinput a,\n\tinput b,\n\tinput sel,\n\toutput out\n);\n\tassign out = sel ? b : a;\nendmodule\n", "module top_module (\n\tinput a,\n\tinput b,\n\tinput sel,\n\toutput out\n);\n\tassign out = (sel) ? b : a;\nendmodule\n", "module top_module (\n\tinput a,\n\tinput b,\n\tinput sel,\n\toutput out\n);\n\tassign out = sel ? b : a;\nendmodule\n", "module top_module (\n\tinput a,\n\tinput b,\n\tinput sel,\n\toutput out\n);\n\tassign out = sel ? b : a;\nendmodule\n", "module top_module (\n\tinput a,\n\tinput b,\n\tinput sel,\n\toutput out\n);\n\tassign out = sel ? b : a;\nendmodule\n", "module top_module (\n input a,\n input b,\n input sel,\n output out\n);\n assign out = sel ? b : a;\nendmodule\n", "module top_module (\n input a,\n input b,\n input sel,\n output out\n);\n assign out = sel ? b : a;\nendmodule\n", "module top_module (\n\tinput a,\n\tinput b,\n\tinput sel,\n\toutput out\n);\n\tassign out = sel ? b : a;\nendmodule\n"]}
{"task_id": "gates4", "llmgen_RTL": ["module top_module (\n input [3:0] in,\n output out_and,\n output out_or,\n output out_xor\n);\n\nassign out_and = in[0] & in[1] & in[2] & in[3];\nassign out_or = in[0] | in[1] | in[2] | in[3];\nassign out_xor = in[0] ^ in[1] ^ in[2] ^ in[3];\n\nendmodule\n", "module top_module (\n input [3:0] in,\n output out_and,\n output out_or,\n output out_xor\n);\n\nassign out_and = in[0] & in[1] & in[2] & in[3];\nassign out_or = in[0] | in[1] | in[2] | in[3];\nassign out_xor = in[0] ^ in[1] ^ in[2] ^ in[3];\n\nendmodule\n", "module top_module (\n\tinput [3:0] in,\n\toutput out_and,\n\toutput out_or,\n\toutput out_xor\n);\n\n\tassign out_and = in[0] & in[1] & in[2] & in[3];\n\tassign out_or = in[0] | in[1] | in[2] | in[3];\n\tassign out_xor = in[0] ^ in[1] ^ in[2] ^ in[3];\n\nendmodule\n", "module top_module (\n input [3:0] in,\n output out_and,\n output out_or,\n output out_xor\n);\n\n assign out_and = in[0] & in[1] & in[2] & in[3];\n assign out_or = in[0] | in[1] | in[2] | in[3];\n assign out_xor = in[0] ^ in[1] ^ in[2] ^ in[3];\n\nendmodule\n", "module top_module (\n\tinput [3:0] in,\n\toutput out_and,\n\toutput out_or,\n\toutput out_xor\n);\n\tassign out_and = in[0] & in[1] & in[2] & in[3];\n\tassign out_or = in[0] | in[1] | in[2] | in[3];\n\tassign out_xor = in[0] ^ in[1] ^ in[2] ^ in[3];\nendmodule\n", "module top_module (\n input [3:0] in,\n output out_and,\n output out_or,\n output out_xor\n);\n\nassign out_and = in[0] & in[1] & in[2] & in[3];\nassign out_or = in[0] | in[1] | in[2] | in[3];\nassign out_xor = in[0] ^ in[1] ^ in[2] ^ in[3];\n\nendmodule\n", "module top_module (\n\tinput [3:0] in,\n\toutput out_and,\n\toutput out_or,\n\toutput out_xor\n);\n\nassign out_and = in[0] & in[1] & in[2] & in[3];\nassign out_or = in[0] | in[1] | in[2] | in[3];\nassign out_xor = in[0] ^ in[1] ^ in[2] ^ in[3];\n\nendmodule\n", "module top_module (\n\tinput [3:0] in,\n\toutput out_and,\n\toutput out_or,\n\toutput out_xor\n);\n\tassign out_and = in[0] & in[1] & in[2] & in[3];\n\tassign out_or = in[0] | in[1] | in[2] | in[3];\n\tassign out_xor = in[0] ^ in[1] ^ in[2] ^ in[3];\nendmodule\n", "module top_module (\n input [3:0] in,\n output out_and,\n output out_or,\n output out_xor\n);\n assign out_and = in[0] & in[1] & in[2] & in[3];\n assign out_or = in[0] | in[1] | in[2] | in[3];\n assign out_xor = in[0] ^ in[1] ^ in[2] ^ in[3];\nendmodule\n", "module top_module (\n\tinput [3:0] in,\n\toutput out_and,\n\toutput out_or,\n\toutput out_xor\n);\n\nassign out_and = in[0] & in[1] & in[2] & in[3];\nassign out_or = in[0] | in[1] | in[2] | in[3];\nassign out_xor = in[0] ^ in[1] ^ in[2] ^ in[3];\n\nendmodule\n", "module top_module (\n\tinput [3:0] in,\n\toutput out_and,\n\toutput out_or,\n\toutput out_xor\n);\n\nassign out_and = in[0] & in[1] & in[2] & in[3];\nassign out_or = in[0] | in[1] | in[2] | in[3];\nassign out_xor = in[0] ^ in[1] ^ in[2] ^ in[3];\n\nendmodule\n", "module top_module (\n input [3:0] in,\n output out_and,\n output out_or,\n output out_xor\n);\n assign out_and = in[0] & in[1] & in[2] & in[3];\n assign out_or = in[0] | in[1] | in[2] | in[3];\n assign out_xor = in[0] ^ in[1] ^ in[2] ^ in[3];\nendmodule\n", "module top_module (\n\tinput [3:0] in,\n\toutput out_and,\n\toutput out_or,\n\toutput out_xor\n);\n\n\tassign out_and = in[0] & in[1] & in[2] & in[3];\n\tassign out_or = in[0] | in[1] | in[2] | in[3];\n\tassign out_xor = in[0] ^ in[1] ^ in[2] ^ in[3];\n\nendmodule\n", "module top_module (\n\tinput [3:0] in,\n\toutput out_and,\n\toutput out_or,\n\toutput out_xor\n);\n\n\tassign out_and = in[0] & in[1] & in[2] & in[3];\n\tassign out_or = in[0] | in[1] | in[2] | in[3];\n\tassign out_xor = in[0] ^ in[1] ^ in[2] ^ in[3];\n\nendmodule\n", "module top_module (\n\tinput [3:0] in,\n\toutput out_and,\n\toutput out_or,\n\toutput out_xor\n);\n\n\tassign out_and = in[0] & in[1] & in[2] & in[3];\n\tassign out_or = in[0] | in[1] | in[2] | in[3];\n\tassign out_xor = in[0] ^ in[1] ^ in[2] ^ in[3];\n\nendmodul
{"task_id": "2014_q3bfsm", "llmgen_RTL": ["module top_module (\n\tinput clk,\n\tinput reset,\n\tinput x,\n\toutput reg z\n);\n \n reg [2:0] state, next_state;\n\n // State encoding\n localparam S000 = 3'b000, S001 = 3'b001, S010 = 3'b010, S011 = 3'b011, S100 = 3'b100;\n\n // Next state logic\n always @(*) begin\n case(state)\n S000: next_state = (x == 0) ? S000 : S001;\n S001: next_state = (x == 0) ? S001 : S100;\n S010: next_state = (x == 0) ? S010 : S001;\n S011: next_state = (x == 0) ? S001 : S010;\n S100: next_state = (x == 0) ? S011 : S100;\n default: next_state = S000;\n endcase\n end\n\n // Output logic\n always @(*) begin\n case(state)\n S011: z = 1;\n S000: z = 0;\n S001: z = 0;\n S010: z = 0;\n S100: z = 1;\n default: z = 0;\n endcase\n end\n\n // State register\n always @(posedge clk) begin\n if (reset)\n state <= S000;\n else\n state <= next_state;\n end\n\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput reset,\n\tinput x,\n\toutput reg z\n);\n\treg [2:0] state, next_state;\n\n\talways @(posedge clk) begin\n\t\tif (reset) begin\n\t\t\tstate <= 3'b000;\n\t\tend else begin\n\t\t\tstate <= next_state;\n\t\tend\n\tend\n\n\talways @(*) begin\n\t\tcase (state)\n\t\t\t3'b000: begin\n\t\t\t\tif (x) begin\n\t\t\t\t\tnext_state = 3'b001;\n\t\t\t\t\tz = 1'b0;\n\t\t\t\tend else begin\n\t\t\t\t\tnext_state = 3'b000;\n\t\t\t\t\tz = 1'b0;\n\t\t\t\tend\n\t\t\tend\n\t\t\t3'b001: begin\n\t\t\t\tif (x) begin\n\t\t\t\t\tnext_state = 3'b100;\n\t\t\t\t\tz = 1'b0;\n\t\t\t\tend else begin\n\t\t\t\t\tnext_state = 3'b001;\n\t\t\t\t\tz = 1'b0;\n\t\t\t\tend\n\t\t\tend\n\t\t\t3'b010: begin\n\t\t\t\tif (x) begin\n\t\t\t\t\tnext_state = 3'b001;\n\t\t\t\t\tz = 1'b0;\n\t\t\t\tend else begin\n\t\t\t\t\tnext_state = 3'b010;\n\t\t\t\t\tz = 1'b0;\n\t\t\t\tend\n\t\t\tend\n\t\t\t3'b011: begin\n\t\t\t\tif (x) begin\n\t\t\t\t\tnext_state = 3'b010;\n\t\t\t\t\tz = 1'b1;\n\t\t\t\tend else begin\n\t\t\t\t\tnext_state = 3'b001;\n\t\t\t\t\tz = 1'b1;\n\t\t\t\tend\n\t\t\tend\n\t\t\t3'b100: begin\n\t\t\t\tif (x) begin\n\t\t\t\t\tnext_state = 3'b100;\n\t\t\t\t\tz = 1'b1;\n\t\t\t\tend else begin\n\t\t\t\t\tnext_state = 3'b011;\n\t\t\t\t\tz = 1'b1;\n\t\t\t\tend\n\t\t\tend\n\t\t\tdefault: begin\n\t\t\t\tnext_state = 3'b000;\n\t\t\t\tz = 1'b0;\n\t\t\tend\n\t\tendcase\n\tend\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput reset,\n\tinput x,\n\toutput reg z\n);\n\treg [2:0] y; // Current state\n-reg [2:0] next_state; // Next state\n\n\t// State transition\n\talways @(*) begin\n\t\tcase (y)\n\t\t\t3'b000: next_state = (x) ? 3'b001 : 3'b000;\n\t\t\t3'b001: next_state = (x) ? 3'b100 : 3'b001;\n\t\t\t3'b010: next_state = (x) ? 3'b001 : 3'b010;\n\t\t\t3'b011: next_state = (x) ? 3'b010 : 3'b001;\n\t\t\t3'b100: next_state = (x) ? 3'b100 : 3'b011;\n\t\t\tdefault: next_state = 3'b000; // Default state\n\t\tendcase\n\tend\n\n\t// Output logic\n\talways @(*) begin\n\t\tcase (y)\n\t\t\t3'b011: z = 1;\n\t\t\tdefault: z = 0;\n\t\tendcase\n\tend\n\n\t// State register\n\talways @(posedge clk) begin\n\t\tif (reset) begin\n\t\t\ty <= 3'b000; // Reset to state 000\n\t\tend else begin\n\t\t\ty <= next_state; // Update state\n\t\tend\n\tend\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput reset,\n\tinput x,\n\toutput reg z\n);\n\n\treg [2:0] state, next_state;\n\n\t// State encoding\n\tparameter S0 = 3'b000;\n\tparameter S1 = 3'b001;\n\tparameter S2 = 3'b010;\n\tparameter S3 = 3'b011;\n\tparameter S4 = 3'b100;\n\n\t// State transition\n\talways @(*) begin\n\t\tcase (state)\n\t\t\tS0: next_state = (x == 0) ? S0 : S1;\n\t\t\tS1: next_state = (x == 0) ? S1 : S4;\n\t\t\tS2: next_state = (x == 0) ? S2 : S1;\n\t\t\tS3: next_state = (x == 0) ? S1 : S2;\n\t\t\tS4: next_state = (x == 0) ? S3 : S4;\n\t\t\tdefault: next_state = S0;\n\t\tendcase\n\tend\n\n\t// Output logic\n\talways @(*) begin\n\t\tcase (state)\n\t\t\tS0: z = 0;\n\t\t\t
{"task_id": "2013_q2bfsm", "llmgen_RTL": ["module top_module (\n input clk,\n input resetn,\n input x,\n input y,\n output reg f,\n output reg g\n);\n\n typedef enum reg [1:0] {STATE_A, STATE_B, STATE_C, STATE_D} state_type;\n state_type state, next_state;\n\n reg [1:0] x_count; // Counter for x values\n reg y_flag; // Flag to indicate if y=1 was seen\n\n always @(posedge clk or negedge resetn) begin\n if (!resetn) begin\n state <= STATE_A;\n f <= 0;\n g <= 0;\n x_count <= 0;\n y_flag <= 0;\n end else begin\n state <= next_state;\n if (next_state == STATE_B) begin\n f <= 1; // Activate f for one cycle\n end else begin\n f <= 0; // Deactivate f otherwise\n end\n\n if (next_state == STATE_C) begin\n if (y) begin\n g <= 1; // Maintain g = 1 if y = 1\n end else if (x_count == 2) begin\n g <= 0; // Set g = 0 if y != 1 within 2 cycles\n end\n end\n end\n end\n\n always @(*) begin\n case (state)\n STATE_A: begin\n if (!resetn) begin\n next_state = STATE_A;\n end else begin\n next_state = STATE_B;\n x_count = 0; // Reset x count\n end\n end\n STATE_B: begin\n next_state = STATE_C; // Move to monitoring state\n end\n STATE_C: begin\n if (x) begin\n x_count = x_count + 1; // Count 1s from x\n end\n if (x_count == 3) begin\n next_state = STATE_D; // Transition if 1, 0, 1 is detected\n end else begin\n next_state = STATE_C; // Stay in state C\n end\n end\n STATE_D: begin\n if (y) begin\n y_flag = 1;\n g = 1; // Keep g = 1 if y detected\n end else if (!y_flag) begin\n if (x_count < 2) begin\n next_state = STATE_D; // Monitor y for up to 2 cycles\n end else begin\n g = 0; // Set g = 0 if y not found\n next_state = STATE_A; // Return to reset state\n end\n end else begin\n next_state = STATE_D; // Stay in state D\n end\n end\n default: next_state = STATE_A;\n endcase\n end\nendmodule\n", "module top_module (\n input clk,\n input resetn,\n input x,\n input y,\n output reg f,\n output reg g\n);\n\n typedef enum reg [2:0] {A, B, C, D} state_t;\n state_t state, next_state;\n reg [1:0] x_count;\n reg y_detected;\n\n always @(posedge clk or negedge resetn) begin\n if (!resetn) begin\n state <= A;\n f <= 0;\n g <= 0;\n x_count <= 0;\n y_detected <= 0;\n end else begin\n state <= next_state;\n if (next_state == B)\n f <= 1;\n else\n f <= 0;\n\n if (next_state == C)\n g <= 1;\n else if (next_state == D)\n g <= 0;\n end\n end\n\n always @(*) begin\n next_state = state;\n case (state)\n A: begin\n if (!resetn) begin\n next_state = A;\n end else begin\n next_state = B;\n end\n end\n B: begin\n if (x) begin\n x_count = x_count + 1;\n if (x_count == 2) begin\n next_state = C;\n end\n end else begin\n x_count = 0;\n end\n end\n
{"task_id": "dff8p", "llmgen_RTL": ["module top_module(\n\tinput clk,\n\tinput [7:0] d,\n\tinput reset,\n\toutput reg [7:0] q);\n\t\n\talways @(negedge clk) begin\n\t\tif (reset) begin\n\t\t\tq <= 8'h34;\n\t\tend else begin\n\t\t\tq <= d;\n\t\tend\n\tend\n\t\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput [7:0] d,\n\tinput reset,\n\toutput reg [7:0] q);\n\n\talways @(negedge clk or posedge reset) begin\n\t\tif (reset) begin\n\t\t\tq <= 8'h34; // Reset value\n\t\tend else begin\n\t\t\tq <= d; // Update q with the input d\n\t\tend\n\tend\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput [7:0] d,\n\tinput reset,\n\toutput reg [7:0] q);\n\n\talways @(negedge clk or posedge reset) begin\n\t\tif (reset) begin\n\t\t\tq <= 8'h34;\n\t\tend else begin\n\t\t\tq <= d;\n\t\tend\n\tend\nendmodule\n", "module top_module(\n input clk,\n input [7:0] d,\n input reset,\n output reg [7:0] q);\n\n always @(negedge clk) begin\n if (reset) begin\n q <= 8'h34;\n end else begin\n q <= d;\n end\n end\n\nendmodule\n", "module top_module(\n input clk,\n input [7:0] d,\n input reset,\n output reg [7:0] q\n);\n always @(negedge clk or posedge reset) begin\n if (reset) begin\n q <= 8'h34;\n end else begin\n q <= d;\n end\n end\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput [7:0] d,\n\tinput reset,\n\toutput reg [7:0] q);\n\n\talways @(negedge clk) begin\n\t\tif (reset)\n\t\t\tq <= 8'h34; // Reset to 0x34\n\t\telse\n\t\t\tq <= d; // Load the value of d\n\tend\nendmodule\n", "module top_module(\n input clk,\n input [7:0] d,\n input reset,\n output reg [7:0] q\n);\n\nalways @(negedge clk or posedge reset) begin\n if (reset) begin\n q <= 8'b00110100; // 0x34\n end else begin\n q <= d;\n end\nend\n\nendmodule\n", "module top_module(\n input clk,\n input [7:0] d,\n input reset,\n output reg [7:0] q);\n\n always @(negedge clk) begin\n if (reset) begin\n q <= 8'b00110100; // 0x34\n end else begin\n q <= d;\n end\n end\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput [7:0] d,\n\tinput reset,\n\toutput reg [7:0] q);\n\nalways @(negedge clk) begin\n\tif (reset) begin\n\t\tq <= 8'h34;\n\tend else begin\n\t\tq <= d;\n\tend\nend\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput [7:0] d,\n\tinput reset,\n\toutput reg [7:0] q);\n\n\talways @(negedge clk or posedge reset) begin\n\t\tif (reset)\n\t\t\tq <= 8'h34;\n\t\telse\n\t\t\tq <= d;\n\tend\n\nendmodule\n", "module top_module(\n input clk,\n input [7:0] d,\n input reset,\n output reg [7:0] q\n);\n always @(negedge clk or posedge reset) begin\n if (reset) begin\n q <= 8'h34;\n end else begin\n q <= d;\n end\n end\nendmodule\n", "module top_module(\n input clk,\n input [7:0] d,\n input reset,\n output reg [7:0] q\n);\n always @(negedge clk or posedge reset) begin\n if (reset) \n q <= 8'h34; // Reset to 0x34\n else \n q <= d; // Update q with d\n end\nendmodule\n", "module top_module(\n input clk,\n input [7:0] d,\n input reset,\n output reg [7:0] q\n);\n \n always @(negedge clk) begin\n if (reset) begin\n q <= 8'h34; \n end else begin\n q <= d;\n end\n end\n \nendmodule\n", "module top_module(\n input clk,\n input [7:0] d,\n input reset,\n output reg [7:0] q\n);\n\nalways @(negedge clk or posedge reset) begin\n if (reset) begin\n q <= 8'b00110100; // Set to 0x34\n end else begin\n q <= d;\n end\nend\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput [7:0] d,\n\tinput reset,\n\toutput reg [7:0] q);\n\t\n\talways @(negedge clk or posedge reset) begin\n\t\tif (reset) begin\n\t\t\tq <= 8'b00110100; // 0x34 in binary\n\t\tend else begin\n\t\t\tq <= d;\n\t\tend\n\tend\nendmodule\n", "module top_module(\n input clk,\n input [7:0] d,
{"task_id": "reduction", "llmgen_RTL": ["module top_module (\n\tinput [7:0] in,\n\toutput parity\n);\n\tassign parity = ^in; // Compute the XOR of all bits in the input to generate even parity\nendmodule\n", "module top_module (\n\tinput [7:0] in,\n\toutput parity\n);\nassign parity = ^in;\nendmodule\n", "module top_module (\n\tinput [7:0] in,\n\toutput parity\n);\n\tassign parity = in[0] ^ in[1] ^ in[2] ^ in[3] ^ in[4] ^ in[5] ^ in[6] ^ in[7];\nendmodule\n", "module top_module (\n\tinput [7:0] in,\n\toutput parity\n);\n\tassign parity = in[0] ^ in[1] ^ in[2] ^ in[3] ^ in[4] ^ in[5] ^ in[6] ^ in[7];\nendmodule\n", "module top_module (\n input [7:0] in,\n output parity\n);\n assign parity = ~(in[0] ^ in[1] ^ in[2] ^ in[3] ^ in[4] ^ in[5] ^ in[6] ^ in[7]);\nendmodule\n", "module top_module (\n\tinput [7:0] in,\n\toutput parity\n);\n\tassign parity = in[0] ^ in[1] ^ in[2] ^ in[3] ^ in[4] ^ in[5] ^ in[6] ^ in[7];\nendmodule\n", "module top_module (\n\tinput [7:0] in,\n\toutput parity\n);\n\tassign parity = ~(in[0] ^ in[1] ^ in[2] ^ in[3] ^ in[4] ^ in[5] ^ in[6] ^ in[7]);\nendmodule\n", "module top_module (\n input [7:0] in,\n output parity\n);\n assign parity = ^in; // Even parity is calculated using XOR of all bits\nendmodule\n", "module top_module (\n\tinput [7:0] in,\n\toutput parity\n);\n\tassign parity = ~(in[0] ^ in[1] ^ in[2] ^ in[3] ^ in[4] ^ in[5] ^ in[6] ^ in[7]);\nendmodule\n", "module top_module (\n\tinput [7:0] in,\n\toutput parity\n);\n\tassign parity = ^in;\nendmodule\n", "module top_module (\n\tinput [7:0] in,\n\toutput parity\n);\n\tassign parity = ^in;\nendmodule\n", "module top_module (\n\tinput [7:0] in,\n\toutput parity\n);\n\nassign parity = ^in;\n\nendmodule\n", "module top_module (\n input [7:0] in,\n output parity\n);\n assign parity = ^in;\nendmodule\n", "module top_module (\n\tinput [7:0] in,\n\toutput parity\n);\n assign parity = in[0] ^ in[1] ^ in[2] ^ in[3] ^ in[4] ^ in[5] ^ in[6] ^ in[7];\nendmodule\n", "module top_module (\n\tinput [7:0] in,\n\toutput parity\n);\n\tassign parity = ^in;\nendmodule\n", "module top_module (\n input [7:0] in,\n output parity\n);\n assign parity = in[0] ^ in[1] ^ in[2] ^ in[3] ^ in[4] ^ in[5] ^ in[6] ^ in[7];\nendmodule\n", "module top_module (\n\tinput [7:0] in,\n\toutput parity\n);\n\tassign parity = ^in;\nendmodule\n", "module top_module (\n input [7:0] in,\n output parity\n);\n\nassign parity = ~(in[0] ^ in[1] ^ in[2] ^ in[3] ^ in[4] ^ in[5] ^ in[6] ^ in[7]);\n\nendmodule\n", "module top_module (\n input [7:0] in,\n output parity\n);\n assign parity = ^in;\nendmodule\n", "module top_module (\n\tinput [7:0] in,\n\toutput parity\n);\nassign parity = ^in;\nendmodule\n"]}
{"task_id": "fsm3comb", "llmgen_RTL": ["module top_module (\n input in,\n input [1:0] state,\n output reg [1:0] next_state,\n output out\n);\n\n always @(*) begin\n case (state)\n 2'b00: next_state = (in == 0) ? 2'b00 : 2'b01; // A\n 2'b01: next_state = (in == 0) ? 2'b10 : 2'b01; // B\n 2'b10: next_state = (in == 0) ? 2'b00 : 2'b11; // C\n 2'b11: next_state = (in == 0) ? 2'b10 : 2'b01; // D\n default: next_state = 2'b00; // Default case\n endcase\n end\n\n assign out = (state == 2'b11) ? 1 : 0; // Output logic based on state D\n\nendmodule\n", "module top_module (\n input in,\n input [1:0] state,\n output reg [1:0] next_state,\n output out\n);\n\nalways @(*) begin\n case(state)\n 2'b00: begin // State A\n next_state = (in) ? 2'b01 : 2'b00; // A -> B if in=1; A -> A if in=0\n out = 0;\n end\n 2'b01: begin // State B\n next_state = (in) ? 2'b01 : 2'b10; // B -> B if in=1; B -> C if in=0\n out = 0;\n end\n 2'b10: begin // State C\n next_state = (in) ? 2'b11 : 2'b00; // C -> D if in=1; C -> A if in=0\n out = 0;\n end\n 2'b11: begin // State D\n next_state = (in) ? 2'b10 : 2'b01; // D -> C if in=1; D -> B if in=0\n out = 1;\n end\n default: begin\n next_state = 2'b00; // Default to state A\n out = 0;\n end\n endcase\nend\n\nendmodule\n", "module top_module (\n input in,\n input [1:0] state,\n output reg [1:0] next_state,\n output out\n);\n \n assign out = (state == 2'b11) ? 1 : 0; // Output logic\n\n always @(*) begin\n case (state)\n 2'b00: next_state = (in == 0) ? 2'b00 : 2'b01; // A\n 2'b01: next_state = (in == 0) ? 2'b10 : 2'b01; // B\n 2'b10: next_state = (in == 0) ? 2'b00 : 2'b11; // C\n 2'b11: next_state = (in == 0) ? 2'b10 : 2'b01; // D\n default: next_state = 2'b00; // Default case\n endcase\n end\n\nendmodule\n", "module top_module (\n input in,\n input [1:0] state,\n output reg [1:0] next_state,\n output out\n);\n\nalways @(*) begin\n case (state)\n 2'b00: next_state = (in == 0) ? 2'b00 : 2'b01; // A\n 2'b01: next_state = (in == 0) ? 2'b10 : 2'b01; // B\n 2'b10: next_state = (in == 0) ? 2'b00 : 2'b11; // C\n 2'b11: next_state = (in == 0) ? 2'b10 : 2'b01; // D\n default: next_state = 2'b00; // Default case\n endcase\nend\n\nassign out = (state == 2'b11) ? 1'b1 : 1'b0; // Output logic for state D\n\nendmodule\n", "module top_module (\n\tinput in,\n\tinput [1:0] state,\n\toutput reg [1:0] next_state,\n\toutput out\n);\n\nalways @(*) begin\n\tcase (state)\n\t\t2'b00: next_state = (in) ? 2'b01 : 2'b00; // State A\n\t\t2'b01: next_state = (in) ? 2'b01 : 2'b10; // State B\n\t\t2'b10: next_state = (in) ? 2'b11 : 2'b00; // State C\n\t\t2'b11: next_state = (in) ? 2'b01 : 2'b10; // State D\n\t\tdefault: next_state = 2'b00; // Default case\n\tendcase\nend\n\nassign out = (state == 2'b11) ? 1 : 0; // Output logic\n\nendmodule\n", "module top_module (\n\tinput in,\n\tinput [1:0] state,\n\toutput reg [1:0] next_state,\n\toutput out\n);\n\nalways @(*) begin\n\tcase (state)\n\t\t2'b00: next_state = (in) ? 2'b01 : 2'b00; // State A\n\t\t2'b01: next_state = (in) ? 2'b01 : 2'b10; // State B\n\t\t2'b10: next_state = (in) ? 2'b11 : 2'b00; // State C\n\t\t2'b11: next_state = (in) ? 2'b01 : 2'b10; // State D\n\t\tdefault: next_state = 2'b00; // Default case\n\tendcase\nend\n\nassign out = (state == 2'b11) ? 1'b1 : 1'b0; // Output logic\n\nendmodule\n", "module top_module (\n input in,\n input [1:0] state,\n output reg [1:0] next_state,\n output out\n);\n\nalways @(*) begin\n case (state)\n 2'b00: next_state = (in == 0) ? 2'b00 : 2'b01; // A\n 2'b01: next_state = (in == 0) ? 2'b10 : 2'b01; // B\n 2'b10: next_state = (in == 0) ? 2'b00 : 2'b11; // C\n 2'b11: next_state = (
{"task_id": "mt2015_q4b", "llmgen_RTL": ["module top_module(\n input x,\n input y,\n output reg z\n);\n always @* begin\n case ({x, y})\n 2'b00: z = 1;\n 2'b01: z = 0;\n 2'b10: z = 0;\n 2'b11: z = 1;\n default: z = 1; // default case to handle any undefined states\n endcase\n end\nendmodule\n", "module top_module(\n input x,\n input y,\n output reg z\n);\n always @(*) begin\n case ({x, y})\n 2'b00: z = 1; // from 0ns to 20ns\n 2'b10: z = 0; // from 25ns to 30ns\n 2'b01: z = 0; // from 35ns to 40ns\n 2'b11: z = 1; // from 45ns to 50ns and 70ns to 70ns\n default: z = 1; // default case for other inputs\n endcase\n end\nendmodule\n", "module top_module(\n input x,\n input y,\n output reg z\n);\n reg [3:0] state;\n \n always @(x, y) begin\n case (state)\n 4'b0000: begin z = 1; end // 0ns to 20ns\n 4'b0001: begin z = 0; end // 25ns to 30ns\n 4'b0010: begin z = 0; end // 35ns to 40ns\n 4'b0011: begin z = 1; end // 45ns to 50ns\n 4'b0100: begin z = 1; end // 55ns to 60ns\n 4'b0101: begin z = 0; end // 60ns to 65ns\n 4'b0110: begin z = 0; end // 65ns to 70ns\n 4'b0111: begin z = 1; end // 70ns to 75ns\n 4'b1000: begin z = 0; end // 75ns to 80ns\n 4'b1001: begin z = 0; end // 80ns to 85ns\n 4'b1010: begin z = 0; end // 85ns to 90ns\n default: begin z = 1; end // default state\n endcase\n end\nendmodule\n", "module top_module(\n input x,\n input y,\n output reg z\n);\n always @(*) begin\n case ({x, y})\n 2'b00: z = 1;\n 2'b01: z = 0;\n 2'b10: z = 0;\n 2'b11: z = 1;\n default: z = 1; // Default case\n endcase\n end\nendmodule\n", "module top_module(\n input x,\n input y,\n output reg z\n);\n always @(*) begin\n case ({x, y})\n 2'b00: z = 1;\n 2'b01: z = 0;\n 2'b10: z = 0;\n 2'b11: z = 1;\n default: z = 1'bx;\n endcase\n end\nendmodule\n", "module top_module(\n input x,\n input y,\n output reg z\n);\n always @(*) begin\n case ({x, y})\n 2'b00: z = 1;\n 2'b01: z = 0;\n 2'b10: z = 0;\n 2'b11: z = 1;\n default: z = 1; // default case to handle unknown states\n endcase\n end\nendmodule\n", "module top_module(\n input x,\n input y,\n output reg z\n);\n always @(*) begin\n case ({x, y})\n 2'b00: z = 1; // For (0, 0)\n 2'b01: z = 0; // For (0, 1)\n 2'b10: z = 0; // For (1, 0)\n 2'b11: z = 1; // For (1, 1)\n default: z = 1; // Default case, can handle unexpected input\n endcase\n end\nendmodule\n", "module top_module(\n input x,\n input y,\n output reg z\n);\n always @(*) begin\n case ({x, y})\n 2'b00: z = 1;\n 2'b01: z = 0;\n 2'b10: z = 0;\n 2'b11: z = 1;\n default: z = 1'bx; // undefined case\n endcase\n end\nendmodule\n", "module top_module(\n input x,\n input y,\n output reg z\n);\n always @(*) begin\n case ({x, y})\n 2'b00: z = 1;\n 2'b01: z = 0;\n 2'b10: z = 0;\n 2'b11: z = 1;\n endcase\n end\nendmodule\n", "module top_module(\n input x,\n input y,\n output reg z\n);\n \n always @(*) begin\n case ({x, y})\n 2'b00: z = 1;\n 2'b01: z = 0;\n 2'b10: z = 0;\n 2'b11: z = 1;\n default: z = 0;\n endcase\n end\n\nendmodule\n", "module top_module(\n input x,\n input y,\n output reg z\n);\n always @(*) begin\n case ({x, y})\n 2'b00: z = 1; // 0ns to 20ns\n 2'b01: z = 0; // 35ns to 40ns\n 2'b10: z
{"task_id": "2012_q2fsm", "llmgen_RTL": ["module top_module (\n input clk,\n input reset,\n input w,\n output reg z\n);\n\n typedef enum reg [2:0] {\n A = 3'b000,\n B = 3'b001,\n C = 3'b010,\n D = 3'b011,\n E = 3'b100,\n F = 3'b101\n } state_t;\n\n state_t current_state, next_state;\n\n always @(posedge clk) begin\n if (reset) \n current_state <= A;\n else \n current_state <= next_state;\n end\n\n always @* begin\n case (current_state)\n A: begin\n if (w) next_state = B;\n else next_state = A;\n z = 0;\n end\n B: begin\n if (w) next_state = C;\n else next_state = D;\n z = 0;\n end\n C: begin\n if (w) next_state = E;\n else next_state = D;\n z = 0;\n end\n D: begin\n if (w) next_state = F;\n else next_state = A;\n z = 0;\n end\n E: begin\n if (w) next_state = E;\n else next_state = D;\n z = 1;\n end\n F: begin\n if (w) next_state = C;\n else next_state = D;\n z = 1;\n end\n default: begin\n next_state = A;\n z = 0;\n end\n endcase\n end\n\nendmodule\n", "module top_module (\n input clk,\n input reset,\n input w,\n output reg z\n);\n\n // State encoding\n typedef enum logic [2:0] {\n A = 3'b000,\n B = 3'b001,\n C = 3'b010,\n D = 3'b011,\n E = 3'b100,\n F = 3'b101\n } state_t;\n\n state_t state, next_state;\n\n // State flip-flops\n always_ff @(posedge clk or posedge reset) begin\n if (reset)\n state <= A;\n else\n state <= next_state;\n end\n\n // State table\n always_comb begin\n case (state)\n A: begin\n if (w) next_state = B;\n else next_state = A;\n z = 0;\n end\n B: begin\n if (w) next_state = C;\n else next_state = D;\n z = 0;\n end\n C: begin\n if (w) next_state = E;\n else next_state = D;\n z = 0;\n end\n D: begin\n if (w) next_state = F;\n else next_state = A;\n z = 0;\n end\n E: begin\n if (w) next_state = E;\n else next_state = D;\n z = 1;\n end\n F: begin\n if (w) next_state = C;\n else next_state = D;\n z = 1;\n end\n default: begin\n next_state = A;\n z = 0;\n end\n endcase\n end\n\nendmodule\n", "module top_module (\n input clk,\n input reset,\n input w,\n output reg z\n);\n\n typedef enum logic [2:0] {\n A = 3'b000,\n B = 3'b001,\n C = 3'b010,\n D = 3'b011,\n E = 3'b100,\n F = 3'b101\n } state_t;\n\n state_t current_state, next_state;\n\n always_ff @(posedge clk or posedge reset) begin\n if (reset)\n current_state <= A;\n else\n current_state <= next_state;\n end\n\n always_comb begin\n case (current_state)\n A: begin\n next_state = (w) ? B : A;\n z = 0;\n end\n B: begin\n next_state = (w) ? C : D;\n z = 0;\n end\n C: begin\n next_state = (w) ? E : D;\n z = 0;\n end\n D: begin\n next_state = (w) ? F : A;\n z = 0;\n end\n E: begin\n
{"task_id": "dff16e", "llmgen_RTL": ["module top_module(\n input clk,\n input resetn,\n input [1:0] byteena,\n input [15:0] d,\n output reg [15:0] q\n);\n\n always @(posedge clk) begin\n if (!resetn) begin\n q <= 16'b0;\n end else begin\n if (byteena[0]) begin\n q[7:0] <= d[7:0];\n end\n if (byteena[1]) begin\n q[15:8] <= d[15:8];\n end\n end\n end\n\nendmodule\n", "module top_module(\n input clk,\n input resetn,\n input [1:0] byteena,\n input [15:0] d,\n output reg [15:0] q);\n\n always @(posedge clk) begin\n if (!resetn) begin\n q <= 16'b0;\n end else begin\n if (byteena[0]) begin\n q[7:0] <= d[7:0];\n end\n if (byteena[1]) begin\n q[15:8] <= d[15:8];\n end\n end\n end\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput resetn,\n\tinput [1:0] byteena,\n\tinput [15:0] d,\n\toutput reg [15:0] q\n);\n\n\talways @(posedge clk) begin\n\t\tif (!resetn) begin\n\t\t\tq <= 16'b0;\n\t\tend else begin\n\t\t\tif (byteena[0]) begin\n\t\t\t\tq[7:0] <= d[7:0];\n\t\t\tend\n\t\t\tif (byteena[1]) begin\n\t\t\t\tq[15:8] <= d[15:8];\n\t\t\tend\n\t\tend\n\tend\n\nendmodule\n", "module top_module(\n input clk,\n input resetn,\n input [1:0] byteena,\n input [15:0] d,\n output reg [15:0] q\n);\n\n reg [15:0] ff;\n\n always @(posedge clk) begin\n if (!resetn) begin\n ff <= 16'b0;\n end else begin\n if (byteena[0]) begin\n ff[7:0] <= d[7:0];\n end\n if (byteena[1]) begin\n ff[15:8] <= d[15:8];\n end\n end\n end\n\n always @(posedge clk) begin\n q <= ff;\n end\n\nendmodule\n", "module top_module(\n input clk,\n input resetn,\n input [1:0] byteena,\n input [15:0] d,\n output reg [15:0] q\n);\n\n reg [15:0] dff;\n\n always @(posedge clk) begin\n if (!resetn) begin\n dff <= 16'b0; // synchronous active-low reset\n end else begin\n if (byteena[0]) begin\n dff[7:0] <= d[7:0]; // write lower byte\n end\n if (byteena[1]) begin\n dff[15:8] <= d[15:8]; // write upper byte\n end\n end\n end\n\n always @(posedge clk) begin\n q <= dff; // output the DFF values\n end\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput resetn,\n\tinput [1:0] byteena,\n\tinput [15:0] d,\n\toutput reg [15:0] q);\n\n\talways @(posedge clk) begin\n\t\tif (!resetn) begin\n\t\t\tq <= 16'b0;\n\t\tend else begin\n\t\t\tif (byteena[0]) begin\n\t\t\t\tq[7:0] <= d[7:0];\n\t\t\tend\n\t\t\tif (byteena[1]) begin\n\t\t\t\tq[15:8] <= d[15:8];\n\t\t\tend\n\t\tend\n\tend\nendmodule\n", "module top_module(\n input clk,\n input resetn,\n input [1:0] byteena,\n input [15:0] d,\n output reg [15:0] q\n);\n always @(posedge clk) begin\n if (!resetn) begin\n q <= 16'b0;\n end else begin\n if (byteena[0]) begin\n q[7:0] <= d[7:0];\n end\n if (byteena[1]) begin\n q[15:8] <= d[15:8];\n end\n end\n end\nendmodule\n", "module top_module(\n input clk,\n input resetn,\n input [1:0] byteena,\n input [15:0] d,\n output reg [15:0] q\n);\n\n reg [15:0] dff;\n\n always @(posedge clk) begin\n if (!resetn) begin\n dff <= 16'b0;\n end else begin\n if (byteena[0]) begin\n dff[7:0] <= d[7:0];\n end\n if (byteena[1]) begin\n dff[15:8] <= d[15:8];\n end\n end\n end\n\n assign q = dff;\n\nendmodule\n", "module top_module(\n input clk,\n input resetn,\n input [1:0] byteena,\n input [15:0] d,\n output reg [15:0] q\n);\n always @(posedge clk) begin\n if (!resetn) begin\n q <= 16'b0;\n
{"task_id": "edgedetect", "llmgen_RTL": ["module top_module(\n\tinput clk,\n\tinput [7:0] in,\n\toutput reg [7:0] pedge);\n\nreg [7:0] prev_in;\n\nalways @(posedge clk) begin\n pedge <= (in & ~prev_in);\n prev_in <= in;\nend\n\nendmodule\n", "module top_module(\n input clk,\n input [7:0] in,\n output reg [7:0] pedge\n);\n reg [7:0] in_d; // Register to hold the previous state of 'in'\n\n always @(posedge clk) begin\n pedge <= in & ~in_d; // Set pedge to 1 where in transitions from 0 to 1\n in_d <= in; // Update previous state with current state\n end\nendmodule\n", "module top_module(\n input clk,\n input [7:0] in,\n output reg [7:0] pedge);\n\n reg [7:0] in_d;\n\n always @(posedge clk) begin\n pedge <= in_d & ~in; // Set pedge on transition from 0 to 1\n in_d <= in; // Store current input\n end\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput [7:0] in,\n\toutput reg [7:0] pedge);\n\n\treg [7:0] in_delayed;\n\n\talways @(posedge clk) begin\n\t\tin_delayed <= in;\n\t\tpedge <= in & ~in_delayed;\n\tend\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput [7:0] in,\n\toutput reg [7:0] pedge);\n\n\treg [7:0] prev_in;\n\n\talways @(posedge clk) begin\n\t\tpedge <= (in & ~prev_in);\n\t\tprev_in <= in;\n\tend\n\nendmodule\n", "module top_module(\n input clk,\n input [7:0] in,\n output reg [7:0] pedge\n);\n\nreg [7:0] prev_in;\n\nalways @(posedge clk) begin\n pedge <= (in & ~prev_in); // Detect 0 to 1 transition\n prev_in <= in; // Store current input for next cycle\nend\n\nendmodule\n", "module top_module(\n input clk,\n input [7:0] in,\n output reg [7:0] pedge\n);\n\n reg [7:0] prev_in;\n\n always @(posedge clk) begin\n pedge <= (prev_in == 8'b00000000 && in == 8'b11111111) ? 8'b11111111 : 8'b00000000;\n prev_in <= in;\n end\n\nendmodule\n", "module top_module(\n input clk,\n input [7:0] in,\n output reg [7:0] pedge\n);\n\n reg [7:0] prev_in;\n\n always @(posedge clk) begin\n pedge <= (prev_in == 8'b00000000) & in; // Set pedge when transition from 0 to 1\n prev_in <= in; // Store the current input for the next cycle\n end\n\nendmodule\n", "module top_module(\n input clk,\n input [7:0] in,\n output reg [7:0] pedge\n);\n reg [7:0] in_d;\n\n always @(posedge clk) begin\n pedge <= (in & ~in_d); // Detect rising edges\n in_d <= in; // Store current state for the next cycle\n end\nendmodule\n", "module top_module(\n input clk,\n input [7:0] in,\n output reg [7:0] pedge\n);\n reg [7:0] in_d;\n\n always @(posedge clk) begin\n pedge <= (in & ~in_d);\n in_d <= in;\n end\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput [7:0] in,\n\toutput reg [7:0] pedge);\n\n\treg [7:0] in_d; // Delayed input signal\n\n\talways @(posedge clk) begin\n\t\tin_d <= in; // Store the current input\n\t\tpedge <= (in & ~in_d); // Detect positive edge\n\tend\n\nendmodule\n", "module top_module(\n input clk,\n input [7:0] in,\n output reg [7:0] pedge\n);\n\n reg [7:0] in_prev;\n\n always @(posedge clk) begin\n pedge <= (in & ~in_prev);\n in_prev <= in;\n end\n\nendmodule\n", "module top_module(\n input clk,\n input [7:0] in,\n output reg [7:0] pedge\n);\n\nreg [7:0] prev_in;\n\nalways @(posedge clk) begin\n pedge <= (in & ~prev_in);\n prev_in <= in;\nend\n\nendmodule\n", "module top_module(\n input clk,\n input [7:0] in,\n output reg [7:0] pedge\n);\n\n reg [7:0] in_prev;\n\n always @(posedge clk) begin\n pedge <= in & ~in_prev; // Set pedge to 1 where in transitions from 0 to 1\n in_prev <= in; // Store the previous state of in\n end\n\nendmodule\n", "module top_module(\n input clk,\n input [7:0] in,\n output reg [7:0] pedge\n);\n\n reg [7:0] prev_in;\n\n always @(posedge clk) begin\n pedge <= (in & ~prev_in);\n prev_in <= in;\n end\n\nendmodule\n", "module top_module(\n input clk,\n input [
{"task_id": "circuit8", "llmgen_RTL": ["module top_module (\n\tinput clock,\n\tinput a, \n\toutput reg p,\n\toutput reg q\n);\n\treg [1:0] state;\n\talways @(posedge clock) begin\n\t\tcase (state)\n\t\t\t2'b00: begin\n\t\t\t\tp <= 0;\n\t\t\t\tq <= 0;\n\t\t\t\tif (a) state <= 2'b01;\n\t\t\tend\n\t\t\t2'b01: begin\n\t\t\t\tp <= 0;\n\t\t\t\tq <= 0;\n\t\t\t\tif (a) state <= 2'b10;\n\t\t\tend\n\t\t\t2'b10: begin\n\t\t\t\tp <= 1;\n\t\t\t\tq <= 0;\n\t\t\t\tstate <= 2'b00; \n\t\t\tend\n\t\t\tdefault: state <= 2'b00;\n\t\tendcase\n\tend\nendmodule\n", "module top_module (\n\tinput clock,\n\tinput a, \n\toutput reg p,\n\toutput reg q\n);\n\treg [1:0] state;\n\tparameter S0 = 2'b00, S1 = 2'b01, S2 = 2'b10, S3 = 2'b11;\n\n\talways @(posedge clock) begin\n\t\tcase (state)\n\t\t\tS0: begin\n\t\t\t\tp <= 0;\n\t\t\t\tq <= 0;\n\t\t\t\tif (a) state <= S1;\n\t\t\tend\n\t\t\tS1: begin\n\t\t\t\tp <= 0;\n\t\t\t\tq <= 0;\n\t\t\t\tif (~a) state <= S2;\n\t\t\tend\n\t\t\tS2: begin\n\t\t\t\tp <= 1;\n\t\t\t\tq <= 0;\n\t\t\t\tif (a) state <= S3;\n\t\t\tend\n\t\t\tS3: begin\n\t\t\t\tp <= 1;\n\t\t\t\tq <= 1;\n\t\t\t\tif (~a) state <= S0;\n\t\t\tend\n\t\t\tdefault: state <= S0;\n\t\tendcase\n\tend\n\t\n\tinitial begin\n\t\tstate = S0;\n\t\tp = 0;\n\t\tq = 0;\n\tend\nendmodule\n", "module top_module (\n\tinput clock,\n\tinput a, \n\toutput reg p,\n\toutput reg q\n);\n\nreg [1:0] state;\n\nalways @(posedge clock) begin\n\tif (state == 2'b00) begin\n\t\tp <= 0;\n\t\tq <= 0;\n\t\tif (a == 1) state <= 2'b01;\n\tend\n\telse if (state == 2'b01) begin\n\t\tp <= 1;\n\t\tq <= 0;\n\t\tif (a == 0) state <= 2'b10;\n\tend\n\telse if (state == 2'b10) begin\n\t\tp <= 1;\n\t\tq <= 1;\n\t\tstate <= 2'b11;\n\tend\n\telse if (state == 2'b11) begin\n\t\tp <= 0;\n\t\tq <= 1;\n\t\tif (a == 0) state <= 2'b00;\n\tend\nend\n\nendmodule\n", "module top_module (\n input clock,\n input a, \n output reg p,\n output reg q\n);\n reg [1:0] state, next_state;\n\n always @(posedge clock) begin\n state <= next_state;\n end\n\n always @(*) begin\n case (state)\n 2'b00: begin\n p = 0;\n q = 0;\n if (a) \n next_state = 2'b01;\n else \n next_state = 2'b00;\n end\n 2'b01: begin\n p = 0;\n q = 0;\n if (a) \n next_state = 2'b10;\n else \n next_state = 2'b01;\n end\n 2'b10: begin\n p = 1;\n q = 0;\n if (a) \n next_state = 2'b11;\n else \n next_state = 2'b10;\n end\n 2'b11: begin\n p = 1;\n q = 1;\n if (a) \n next_state = 2'b11;\n else \n next_state = 2'b00;\n end\n default: begin\n p = 0;\n q = 0;\n next_state = 2'b00;\n end\n endcase\n end\nendmodule\n", "module top_module (\n\tinput clock,\n\tinput a, \n\toutput reg p,\n\toutput reg q\n);\n\n\treg [1:0] state;\n\tparameter IDLE = 2'b00, STATE1 = 2'b01, STATE2 = 2'b10, STATE3 = 2'b11;\n\n\talways @(posedge clock) begin\n\t\tcase (state)\n\t\t\tIDLE: begin\n\t\t\t\tp <= 0;\n\t\t\t\tq <= 0;\n\t\t\t\tif (a) \n\t\t\t\t\tstate <= STATE1;\n\t\t\tend\n\n\t\t\tSTATE1: begin\n\t\t\t\tp <= 0;\n\t\t\t\tq <= 0;\n\t\t\t\tif (a) \n\t\t\t\t\tstate <= STATE2;\n\t\t\t\telse \n\t\t\t\t\tstate <= IDLE;\n\t\t\tend\n\n\t\t\tSTATE2: begin\n\t\t\t\tp <= 1;\n\t\t\t\tq <= 0;\n\t\t\t\tif (a) \n\t\t\t\t\tstate <= STATE3;\n\t\t\t\telse \n\t\t\t\t\tstate <= IDLE;\n\t\t\tend\n\n\t\t\tSTATE3: begin\n\t\t\t\tp <= 1;\n\t\t\t\tq <= 1;\n\t\t\t\tif (a) \n\t\t\t\t\tstate <= STATE3; // stay in STATE3\n\t\t\t\telse \n\t\t\t\t\tstate <= IDLE;\n\t\t\tend\n\n\t\t\tdefault: state <= IDLE;\n\t\tendcase\n\tend\n\nendmodule\n", "module top_module (\n input clock,\n input a, \n output reg p,\n
{"task_id": "rule90", "llmgen_RTL": ["module top_module(\n input clk,\n input load,\n input [511:0] data,\n output reg [511:0] q\n);\n reg [511:0] next_q;\n\n always @(*) begin\n next_q[0] = 1'b0 ^ q[1]; // Left boundary is assumed to be 0\n next_q[511] = q[510] ^ 1'b0; // Right boundary is assumed to be 0\n \n for (int i = 1; i < 511; i = i + 1) begin\n next_q[i] = q[i-1] ^ q[i+1];\n end\n end\n\n always @(posedge clk) begin\n if (load) begin\n q <= data;\n end else begin\n q <= next_q;\n end\n end\nendmodule\n", "module top_module(\n input clk,\n input load,\n input [511:0] data,\n output reg [511:0] q\n);\n\n reg [511:0] next_q;\n\n always @(posedge clk) begin\n if (load) begin\n q <= data;\n end else begin\n q <= next_q;\n end\n end\n\n always @* begin\n next_q[0] = 1'b0 ^ q[1]; // Left boundary is 0\n next_q[511] = q[510] ^ 1'b0; // Right boundary is 0\n \n for (int i = 1; i < 511; i = i + 1) begin\n next_q[i] = q[i-1] ^ q[i+1];\n end\n end\n\nendmodule\n", "module top_module(\n input clk,\n input load,\n input [511:0] data,\n output reg [511:0] q\n);\n reg [511:0] next_q;\n\n always @(posedge clk) begin\n if (load) begin\n q <= data;\n end else begin\n q <= next_q;\n end\n end\n\n always @* begin\n next_q[0] = 0 ^ q[0] ^ q[1]; // Left boundary is 0\n for (integer i = 1; i < 511; i = i + 1) begin\n next_q[i] = q[i-1] ^ q[i+1];\n end\n next_q[511] = q[510] ^ 0; // Right boundary is 0\n end\nendmodule\n", "module top_module(\n input clk,\n input load,\n input [511:0] data,\n output reg [511:0] q\n);\n\n reg [511:0] next_q;\n\n always @(posedge clk) begin\n if (load) begin\n q <= data;\n end else begin\n q <= next_q;\n end\n end\n\n always @* begin\n next_q[0] = (q[0] ^ 0 ^ q[1]); // q[-1] is considered 0\n for (integer i = 1; i < 511; i = i + 1) begin\n next_q[i] = (q[i-1] ^ q[i] ^ q[i+1]);\n end\n next_q[511] = (q[510] ^ q[511] ^ 0); // q[512] is considered 0\n end\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput load,\n\tinput [511:0] data,\n\toutput reg [511:0] q);\n\n\talways @(posedge clk) begin\n\t\tif (load) begin\n\t\t\tq <= data;\n\t\tend else begin\n\t\t\tq <= {1'b0, q[511:1] ^ q[510:0], 1'b0}; // Update state according to Rule 90\n\t\tend\n\tend\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput load,\n\tinput [511:0] data,\n\toutput reg [511:0] q\n);\n\n\talways @(posedge clk) begin\n\t\tif (load) begin\n\t\t\tq <= data;\n\t\tend else begin\n\t\t\tq <= {1'b0, q[511:1] ^ q[510:0], 1'b0}; // Apply Rule 90\n\t\tend\n\tend\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput load,\n\tinput [511:0] data,\n\toutput reg [511:0] q);\n\n\talways @(posedge clk) begin\n\t\tif (load) begin\n\t\t\tq <= data;\n\t\tend else begin\n\t\t\tq <= {1'b0, q[511:1] ^ q[510:0], 1'b0}; // Apply Rule 90\n\t\tend\n\tend\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput load,\n\tinput [511:0] data,\n\toutput reg [511:0] q);\n\n\talways @(posedge clk) begin\n\t\tif (load) begin\n\t\t\tq <= data;\n\t\tend else begin\n\t\t\tq[0] <= 1'b0 ^ q[1]; // q[-1] is considered as 0\n\t\t\tfor (integer i = 1; i < 511; i = i + 1) begin\n\t\t\t\tq[i] <= q[i-1] ^ q[i+1];\n\t\t\tend\n\t\t\tq[511] <= q[510] ^ 1'b0; // q[512] is considered as 0\n\t\tend\n\tend\nendmodule\n", "module top_module(\n input clk,\n input load,\n input [511:0] data,\n output reg [511:0] q\n);\n \n reg [511:0] next_q;\n\n always @* begin\n next_q[0] = 1'b0 ^ q[1]; // q[-1] is assumed to be 0\n next_q[511] = q[510] ^ 1'b0; // q[512] is assumed to be 0\n for (integer i = 1; i < 511; i = i + 1) begin\n next_q[i] = q[i-1] ^ q[i+1];\n end\n end
{"task_id": "mt2015_eq2", "llmgen_RTL": ["module top_module(\n\tinput [1:0] A,\n\tinput [1:0] B,\n\toutput z);\n\n\tassign z = (A == B) ? 1'b1 : 1'b0;\n\nendmodule\n", "module top_module(\n\tinput [1:0] A,\n\tinput [1:0] B,\n\toutput z\n);\n\tassign z = (A == B) ? 1'b1 : 1'b0;\nendmodule\n", "module top_module(\n input [1:0] A,\n input [1:0] B,\n output z\n);\n\nassign z = (A == B) ? 1'b1 : 1'b0;\n\nendmodule\n", "module top_module(\n\tinput [1:0] A,\n\tinput [1:0] B,\n\toutput z);\n\n\tassign z = (A == B) ? 1'b1 : 1'b0;\n\nendmodule\n", "module top_module(\n\tinput [1:0] A,\n\tinput [1:0] B,\n\toutput z);\n\n\tassign z = (A == B) ? 1'b1 : 1'b0;\n\nendmodule\n", "module top_module(\n input [1:0] A,\n input [1:0] B,\n output z\n);\n assign z = (A == B) ? 1'b1 : 1'b0;\nendmodule\n", "module top_module(\n\tinput [1:0] A,\n\tinput [1:0] B,\n\toutput z);\n \n\tassign z = (A == B) ? 1'b1 : 1'b0;\n \nendmodule\n", "module top_module(\n input [1:0] A,\n input [1:0] B,\n output z);\n \n assign z = (A == B) ? 1'b1 : 1'b0;\n\nendmodule\n", "module top_module(\n\tinput [1:0] A,\n\tinput [1:0] B,\n\toutput z);\n\t\n\tassign z = (A == B) ? 1'b1 : 1'b0;\n\nendmodule\n", "module top_module(\n input [1:0] A,\n input [1:0] B,\n output z\n);\n assign z = (A == B) ? 1'b1 : 1'b0;\nendmodule\n", "module top_module(\n\tinput [1:0] A,\n\tinput [1:0] B,\n\toutput z);\n\n\tassign z = (A == B) ? 1'b1 : 1'b0;\n\nendmodule\n", "module top_module(\n\tinput [1:0] A,\n\tinput [1:0] B,\n\toutput z);\n\n\tassign z = (A == B) ? 1'b1 : 1'b0;\n\nendmodule\n", "module top_module(\n input [1:0] A,\n input [1:0] B,\n output z\n);\n assign z = (A == B) ? 1'b1 : 1'b0;\nendmodule\n", "module top_module(\n\tinput [1:0] A,\n\tinput [1:0] B,\n\toutput z);\n \n\tassign z = (A == B) ? 1'b1 : 1'b0;\n\nendmodule\n", "module top_module(\n\tinput [1:0] A,\n\tinput [1:0] B,\n\toutput z\n);\n\tassign z = (A == B) ? 1'b1 : 1'b0;\nendmodule\n", "module top_module(\n input [1:0] A,\n input [1:0] B,\n output z\n);\n\nassign z = (A == B) ? 1 : 0;\n\nendmodule\n", "module top_module(\n\tinput [1:0] A,\n\tinput [1:0] B,\n\toutput z\n);\n\tassign z = (A == B) ? 1'b1 : 1'b0;\nendmodule\n", "module top_module(\n input [1:0] A,\n input [1:0] B,\n output z\n);\n assign z = (A == B) ? 1'b1 : 1'b0;\nendmodule\n", "module top_module(\n\tinput [1:0] A,\n\tinput [1:0] B,\n\toutput z);\n\n\tassign z = (A == B) ? 1'b1 : 1'b0;\n\nendmodule\n", "module top_module(\n input [1:0] A,\n input [1:0] B,\n output z\n);\n\nassign z = (A == B) ? 1'b1 : 1'b0;\n\nendmodule\n"]}
{"task_id": "gatesv100", "llmgen_RTL": ["module top_module (\n input [99:0] in,\n output [98:0] out_both,\n output [99:1] out_any,\n output [99:0] out_different\n);\n\n assign out_both = in[99:1] & in[98:0];\n\n assign out_any = in[99:1] | in[98:0];\n\n assign out_different = (in[99] != in[0]) ? {in[98:1] != in[99:0]} : (in[98:0] != in[99:1]);\n\nendmodule\n", "module top_module (\n input [99:0] in,\n output [98:0] out_both,\n output [99:1] out_any,\n output [99:0] out_different\n);\n\n // out_both: Check if both current and left neighbor are 1\n genvar i;\n generate\n for (i = 0; i < 99; i = i + 1) begin: both\n assign out_both[i] = in[i] & in[i + 1];\n end\n endgenerate\n\n // out_any: Check if either current or right neighbor is 1\n generate\n for (i = 1; i < 100; i = i + 1) begin: any\n assign out_any[i] = in[i] | in[i - 1];\n end\n endgenerate\n\n // out_different: Check if current is different from left neighbor (wrapping around)\n assign out_different[0] = in[0] ^ in[99];\n generate\n for (i = 1; i < 100; i = i + 1) begin: different\n assign out_different[i] = in[i] ^ in[i - 1];\n end\n endgenerate\n\nendmodule\n", "module top_module (\n input [99:0] in,\n output [98:0] out_both,\n output [99:1] out_any,\n output [99:0] out_different\n);\n\n assign out_both[98] = in[98] & in[99];\n // Generate out_both for the rest of the bits\n genvar i;\n generate\n for (i = 0; i < 98; i = i + 1) begin : gen_out_both\n assign out_both[i] = in[i] & in[i + 1];\n end\n endgenerate\n\n assign out_any[99] = in[0] | in[1];\n // Generate out_any for the rest of the bits\n generate\n for (i = 1; i < 99; i = i + 1) begin : gen_out_any\n assign out_any[i] = in[i] | in[i - 1];\n end\n endgenerate\n\n assign out_different[0] = in[0] ^ in[99];\n // Generate out_different for the rest of the bits\n generate\n for (i = 1; i < 99; i = i + 1) begin : gen_out_different\n assign out_different[i] = in[i] ^ in[i - 1];\n end\n endgenerate\nendmodule\n", "module top_module (\n input [99:0] in,\n output [98:0] out_both,\n output [99:1] out_any,\n output [99:0] out_different\n);\n assign out_both = in[98:0] & in[99:1];\n assign out_any = in[0:98] | in[1:99];\n assign out_different = (in[99] !== in[0]) ? 1'b1 : 1'b0; \n genvar i;\n generate\n for (i = 0; i < 99; i = i + 1) begin : diff_loop\n assign out_different[i+1] = (in[i+1] !== in[i]);\n end\n endgenerate\nendmodule\n", "module top_module (\n\tinput [99:0] in,\n\toutput [98:0] out_both,\n\toutput [99:1] out_any,\n\toutput [99:0] out_different\n);\n\nassign out_both[98] = in[98] & in[99];\nassign out_any[99] = in[0] | in[1];\ngenerate\n genvar i;\n for (i = 0; i < 98; i = i + 1) begin: both\n assign out_both[i] = in[i] & in[i + 1];\n end\nendgenerate\n\ngenerate\n for (i = 1; i < 99; i = i + 1) begin: any\n assign out_any[i] = in[i] | in[i - 1];\n end\nendgenerate\n\nassign out_any[0] = 1'b0; // No need to calculate out_any[0]\n\ngenerate\n for (i = 0; i < 99; i = i + 1) begin: different\n assign out_different[i] = in[i] ^ in[i + 1];\n end\nendgenerate\n\nassign out_different[99] = in[99] ^ in[0]; // Wrap-around case\n\nendmodule\n", "module top_module (\n input [99:0] in,\n output [98:0] out_both,\n output [99:1] out_any,\n output [99:0] out_different\n);\n\n assign out_both[98] = in[99] & in[98];\n \n genvar i;\n generate\n for (i = 0; i < 98; i = i + 1) begin : both_logic\n assign out_both[i] = in[i+1] & in[i];\n end\n endgenerate\n\n assign out_any[99] = in[0] | in[1];\n \n generate\n for (i = 1; i < 99; i = i + 1) begin : any_logic\n assign out_any[i] = in[i] | in[i-1];\n end\n endgenerate\n\n assign out_different[0] = in[0] ^ in[99];\n \n g
{"task_id": "m2014_q4a", "llmgen_RTL": ["module top_module (\n input d,\n input ena,\n output logic q\n);\n always @* begin\n if (ena) \n q = d;\n end\nendmodule\n", "module top_module (\n\tinput d,\n\tinput ena,\n\toutput logic q\n);\n\talways_ff @(ena or d) begin\n\t\tif (ena) \n\t\t\tq <= d;\n\tend\nendmodule\n", "module top_module (\n\tinput d,\n\tinput ena,\n\toutput logic q\n);\n\talways @(ena or d) begin\n\t\tif (ena) \n\t\t\tq = d;\n\tend\nendmodule\n", "module top_module (\n\tinput d,\n\tinput ena,\n\toutput logic q\n);\n always_ff @(ena or d) begin\n if (ena) begin\n q <= d;\n end\n end\nendmodule\n", "module top_module (\n\tinput d,\n\tinput ena,\n\toutput logic q\n);\n always_ff @(ena or d) begin\n if (ena) begin\n q <= d;\n end\n end\nendmodule\n", "module top_module (\n input d,\n input ena,\n output logic q\n);\n always_ff @(ena or d) begin\n if (ena) begin\n q <= d;\n end\n end\nendmodule\n", "module top_module (\n input d,\n input ena,\n output logic q\n);\n always @* begin\n if (ena) \n q = d;\n end\nendmodule\n", "module top_module (\n\tinput d,\n\tinput ena,\n\toutput logic q\n);\n\talways_ff @(ena or d) begin\n\t\tif (ena) \n\t\t\tq <= d;\n\tend\nendmodule\n", "module top_module (\n\tinput d,\n\tinput ena,\n\toutput logic q\n);\n\nalways @(ena or d) begin\n\tif (ena) begin\n\t\tq <= d;\n\tend\nend\n\nendmodule\n", "module top_module (\n input d,\n input ena,\n output logic q\n);\n always @* begin\n if (ena) \n q = d;\n end\nendmodule\n", "module top_module (\n\tinput d,\n\tinput ena,\n\toutput logic q\n);\n\talways @* begin\n\t\tif (ena) begin\n\t\t\tq = d;\n\t\tend\n\tend\nendmodule\n", "module top_module (\n\tinput d,\n\tinput ena,\n\toutput logic q\n);\n\talways @* begin\n\t\tif (ena)\n\t\t\tq = d;\n\tend\nendmodule\n", "module top_module (\n\tinput d,\n\tinput ena,\n\toutput logic q\n);\n\talways @* begin\n\t\tif (ena) \n\t\t\tq = d;\n\tend\nendmodule\n", "module top_module (\n\tinput d,\n\tinput ena,\n\toutput logic q\n);\n always @(*) begin\n if (ena)\n q = d;\n end\nendmodule\n", "module top_module (\n\tinput d,\n\tinput ena,\n\toutput logic q\n);\n\talways @(*) begin\n\t\tif (ena) begin\n\t\t\tq = d;\n\t\tend\n\tend\nendmodule\n", "module top_module (\n input d,\n input ena,\n output logic q\n);\n always @(*) begin\n if (ena) \n q = d;\n end\nendmodule\n", "module top_module (\n\tinput d,\n\tinput ena,\n\toutput logic q\n);\n \n\talways_ff @(ena or d) begin\n\t\tif (ena) \n\t\t\tq <= d;\n\tend\n\nendmodule\n", "module top_module (\n input d,\n input ena,\n output logic q\n);\n always_ff @(ena or d) begin\n if (ena) begin\n q <= d;\n end\n end\nendmodule\n", "module top_module (\n\tinput d,\n\tinput ena,\n\toutput logic q\n);\n\talways @ (ena or d) begin\n\t\tif (ena) \n\t\t\tq <= d;\n\tend\nendmodule\n", "module top_module (\n\tinput d,\n\tinput ena,\n\toutput logic q\n);\n\talways_ff @(ena or d) begin\n\t\tif (ena) \n\t\t\tq <= d;\n\tend\nendmodule\n"]}
{"task_id": "mux256to1v", "llmgen_RTL": ["module top_module (\n\tinput [1023:0] in,\n\tinput [7:0] sel,\n\toutput [3:0] out\n);\n\tassign out = in[sel * 4 +: 4];\nendmodule\n", "module top_module (\n input [1023:0] in,\n input [7:0] sel,\n output [3:0] out\n);\n assign out = in[sel * 4 +: 4];\nendmodule\n", "module top_module (\n input [1023:0] in,\n input [7:0] sel,\n output [3:0] out\n);\n\n assign out = in[sel * 4 +: 4];\n\nendmodule\n", "module top_module (\n\tinput [1023:0] in,\n\tinput [7:0] sel,\n\toutput [3:0] out\n);\n\tassign out = in[sel*4 +: 4];\nendmodule\n", "module top_module (\n input [1023:0] in,\n input [7:0] sel,\n output [3:0] out\n);\n assign out = in[sel*4 +: 4];\nendmodule\n", "module top_module (\n\tinput [1023:0] in,\n\tinput [7:0] sel,\n\toutput [3:0] out\n);\n\tassign out = in[sel*4 +: 4];\nendmodule\n", "module top_module (\n\tinput [1023:0] in,\n\tinput [7:0] sel,\n\toutput [3:0] out\n);\n\tassign out = in[sel*4 +: 4];\nendmodule\n", "module top_module (\n\tinput [1023:0] in,\n\tinput [7:0] sel,\n\toutput [3:0] out\n);\n\tassign out = in[sel * 4 +: 4];\nendmodule\n", "module top_module (\n input [1023:0] in,\n input [7:0] sel,\n output [3:0] out\n);\n assign out = in[sel * 4 +: 4];\nendmodule\n", "module top_module (\n input [1023:0] in,\n input [7:0] sel,\n output [3:0] out\n);\n assign out = in[sel * 4 +: 4];\nendmodule\n", "module top_module (\n\tinput [1023:0] in,\n\tinput [7:0] sel,\n\toutput [3:0] out\n);\n\tassign out = in[sel*4 +: 4];\nendmodule\n", "module top_module (\n input [1023:0] in,\n input [7:0] sel,\n output [3:0] out\n);\n assign out = in[sel * 4 +: 4];\nendmodule\n", "module top_module (\n\tinput [1023:0] in,\n\tinput [7:0] sel,\n\toutput [3:0] out\n);\n assign out = in[sel*4 +: 4];\nendmodule\n", "module top_module (\n\tinput [1023:0] in,\n\tinput [7:0] sel,\n\toutput [3:0] out\n);\n\tassign out = in[sel * 4 +: 4];\nendmodule\n", "module top_module (\n input [1023:0] in,\n input [7:0] sel,\n output [3:0] out\n);\n assign out = in[sel*4 +: 4];\nendmodule\n", "module top_module (\n\tinput [1023:0] in,\n\tinput [7:0] sel,\n\toutput [3:0] out\n);\n\tassign out = in[sel * 4 +: 4];\nendmodule\n", "module top_module (\n input [1023:0] in,\n input [7:0] sel,\n output [3:0] out\n);\n assign out = in[sel * 4 +: 4];\nendmodule\n", "module top_module (\n input [1023:0] in,\n input [7:0] sel,\n output [3:0] out\n);\n assign out = in[sel * 4 +: 4];\nendmodule\n", "module top_module (\n input [1023:0] in,\n input [7:0] sel,\n output [3:0] out\n);\n assign out = in[sel * 4 +: 4];\nendmodule\n", "module top_module (\n input [1023:0] in,\n input [7:0] sel,\n output [3:0] out\n);\n assign out = in[(sel * 4) +: 4];\nendmodule\n"]}
{"task_id": "mux9to1v", "llmgen_RTL": ["module top_module (\n\tinput [15:0] a,\n\tinput [15:0] b,\n\tinput [15:0] c,\n\tinput [15:0] d,\n\tinput [15:0] e,\n\tinput [15:0] f,\n\tinput [15:0] g,\n\tinput [15:0] h,\n\tinput [15:0] i,\n\tinput [3:0] sel,\n\toutput logic [15:0] out\n);\n\n\talways_comb begin\n\t\tcase (sel)\n\t\t\t4'b0000: out = a;\n\t\t\t4'b0001: out = b;\n\t\t\t4'b0010: out = c;\n\t\t\t4'b0011: out = d;\n\t\t\t4'b0100: out = e;\n\t\t\t4'b0101: out = f;\n\t\t\t4'b0110: out = g;\n\t\t\t4'b0111: out = h;\n\t\t\t4'b1000: out = i;\n\t\t\tdefault: out = 16'b1111111111111111; // All bits set to '1'\n\t\tendcase\n\tend\n\nendmodule\n", "module top_module (\n input [15:0] a,\n input [15:0] b,\n input [15:0] c,\n input [15:0] d,\n input [15:0] e,\n input [15:0] f,\n input [15:0] g,\n input [15:0] h,\n input [15:0] i,\n input [3:0] sel,\n output logic [15:0] out\n);\n always_comb begin\n case (sel)\n 4'b0000: out = a;\n 4'b0001: out = b;\n 4'b0010: out = c;\n 4'b0011: out = d;\n 4'b0100: out = e;\n 4'b0101: out = f;\n 4'b0110: out = g;\n 4'b0111: out = h;\n 4'b1000: out = i;\n default: out = 16'b1111111111111111;\n endcase\n end\nendmodule\n", "module top_module (\n input [15:0] a,\n input [15:0] b,\n input [15:0] c,\n input [15:0] d,\n input [15:0] e,\n input [15:0] f,\n input [15:0] g,\n input [15:0] h,\n input [15:0] i,\n input [3:0] sel,\n output logic [15:0] out\n);\n\n always @(*) begin\n case (sel)\n 4'b0000: out = a;\n 4'b0001: out = b;\n 4'b0010: out = c;\n 4'b0011: out = d;\n 4'b0100: out = e;\n 4'b0101: out = f;\n 4'b0110: out = g;\n 4'b0111: out = h;\n 4'b1000: out = i;\n default: out = 16'hFFFF; // Set to '1's for sel 9 to 15\n endcase\n end\n\nendmodule\n", "module top_module (\n input [15:0] a,\n input [15:0] b,\n input [15:0] c,\n input [15:0] d,\n input [15:0] e,\n input [15:0] f,\n input [15:0] g,\n input [15:0] h,\n input [15:0] i,\n input [3:0] sel,\n output logic [15:0] out\n);\n always_comb begin\n case (sel)\n 4'b0000: out = a;\n 4'b0001: out = b;\n 4'b0010: out = c;\n 4'b0011: out = d;\n 4'b0100: out = e;\n 4'b0101: out = f;\n 4'b0110: out = g;\n 4'b0111: out = h;\n 4'b1000: out = i;\n default: out = 16'b1111111111111111; // Set to '1' for unused cases\n endcase\n end\nendmodule\n", "module top_module (\n input [15:0] a,\n input [15:0] b,\n input [15:0] c,\n input [15:0] d,\n input [15:0] e,\n input [15:0] f,\n input [15:0] g,\n input [15:0] h,\n input [15:0] i,\n input [3:0] sel,\n output logic [15:0] out\n);\n\n always_comb begin\n case (sel)\n 4'b0000: out = a;\n 4'b0001: out = b;\n 4'b0010: out = c;\n 4'b0011: out = d;\n 4'b0100: out = e;\n 4'b0101: out = f;\n 4'b0110: out = g;\n 4'b0111: out = h;\n 4'b1000: out = i;\n default: out = 16'b1111111111111111;\n endcase\n end\n\nendmodule\n", "module top_module (\n\tinput [15:0] a,\n\tinput [15:0] b,\n\tinput [15:0] c,\n\tinput [15:0] d,\n\tinput [15:0] e,\n\tinput [15:0] f,\n\tinput [15:0] g,\n\tinput [15:0] h,\n\tinput [15:0] i,\n\tinput [3:0] sel,\n\toutput logic [15:0] out\n);\n\nalways_comb begin\n\tcase(sel)\n\t\t4'd0: out = a;\n\t\t4'd1: out = b;\n\t\t4'd2: out = c;\n\t\t4'd3: out = d;\n\t\t4'd4: out = e;\n\t\t4'd5: out = f;\n\t\t4'd6: out = g;\n\t\t4'd7: out = h;\n\t\t4'd8: out = i;\n\t\tdefault: out = 16'hFFFF; // Set all output bits to '1'\n\tendcase\nend\n\nendmodule\n", "module top_module (\n input [15:0] a,\n input [15:0] b,\n input [15:0] c,\n input [15:0] d,\n input [15:0] e,
{"task_id": "vectorgates", "llmgen_RTL": ["module top_module(\n\tinput [2:0] a, \n\tinput [2:0] b, \n\toutput [2:0] out_or_bitwise,\n\toutput out_or_logical,\n\toutput [5:0] out_not\n);\n\tassign out_or_bitwise = a | b;\n\tassign out_or_logical = |a | |b;\n\tassign out_not = {~b, ~a};\nendmodule\n", "module top_module(\n\tinput [2:0] a, \n\tinput [2:0] b, \n\toutput [2:0] out_or_bitwise,\n\toutput out_or_logical,\n\toutput [5:0] out_not\n);\n assign out_or_bitwise = a | b;\n assign out_or_logical = |(a) | |(b);\n assign out_not = {~b, ~a};\nendmodule\n", "module top_module(\n input [2:0] a, \n input [2:0] b, \n output [2:0] out_or_bitwise,\n output out_or_logical,\n output [5:0] out_not\n);\n\n assign out_or_bitwise = a | b;\n assign out_or_logical = |{a, b}; // Logical OR of the two vectors\n assign out_not = {~b, ~a}; // Inverse of b in upper half, a in lower half\n\nendmodule\n", "module top_module(\n input [2:0] a, \n input [2:0] b, \n output [2:0] out_or_bitwise,\n output out_or_logical,\n output [5:0] out_not\n);\n\nassign out_or_bitwise = a | b;\nassign out_or_logical = |(a) | |(b);\nassign out_not = {~b, ~a};\n\nendmodule\n", "module top_module(\n\tinput [2:0] a, \n\tinput [2:0] b, \n\toutput [2:0] out_or_bitwise,\n\toutput out_or_logical,\n\toutput [5:0] out_not\n);\n\tassign out_or_bitwise = a | b;\n\tassign out_or_logical = |(a | b);\n\tassign out_not = {~b, ~a};\nendmodule\n", "module top_module(\n input [2:0] a, \n input [2:0] b, \n output [2:0] out_or_bitwise,\n output out_or_logical,\n output [5:0] out_not\n);\n\nassign out_or_bitwise = a | b;\nassign out_or_logical = |(a) | |(b);\nassign out_not = {~b, ~a};\n\nendmodule\n", "module top_module(\n input [2:0] a, \n input [2:0] b, \n output [2:0] out_or_bitwise,\n output out_or_logical,\n output [5:0] out_not\n);\n\nassign out_or_bitwise = a | b;\nassign out_or_logical = |a | |b;\nassign out_not = {~b, ~a};\n\nendmodule\n", "module top_module(\n input [2:0] a, \n input [2:0] b, \n output [2:0] out_or_bitwise,\n output out_or_logical,\n output [5:0] out_not\n);\n assign out_or_bitwise = a | b;\n assign out_or_logical = |(a | b);\n assign out_not = {~b, ~a};\nendmodule\n", "module top_module(\n\tinput [2:0] a, \n\tinput [2:0] b, \n\toutput [2:0] out_or_bitwise,\n\toutput out_or_logical,\n\toutput [5:0] out_not\n);\n\t\n\tassign out_or_bitwise = a | b;\n\tassign out_or_logical = |(a | b);\n\tassign out_not = {~b, ~a};\n\nendmodule\n", "module top_module(\n\tinput [2:0] a, \n\tinput [2:0] b, \n\toutput [2:0] out_or_bitwise,\n\toutput out_or_logical,\n\toutput [5:0] out_not\n);\n\n\tassign out_or_bitwise = a | b;\n\tassign out_or_logical = |(a) | |(b);\n\tassign out_not = {~b, ~a};\n\nendmodule\n", "module top_module(\n\tinput [2:0] a, \n\tinput [2:0] b, \n\toutput [2:0] out_or_bitwise,\n\toutput out_or_logical,\n\toutput [5:0] out_not\n);\n\n\tassign out_or_bitwise = a | b;\n\tassign out_or_logical = |(a | b);\n\tassign out_not = {~b, ~a};\n\nendmodule\n", "module top_module(\n input [2:0] a, \n input [2:0] b, \n output [2:0] out_or_bitwise,\n output out_or_logical,\n output [5:0] out_not\n);\n assign out_or_bitwise = a | b;\n assign out_or_logical = |(a | b);\n assign out_not = {~b, ~a};\n\nendmodule\n", "module top_module(\n\tinput [2:0] a, \n\tinput [2:0] b, \n\toutput [2:0] out_or_bitwise,\n\toutput out_or_logical,\n\toutput [5:0] out_not\n);\n\tassign out_or_bitwise = a | b;\n\tassign out_or_logical = |(a) | |(b);\n\tassign out_not = {~b, ~a};\nendmodule\n", "module top_module(\n\tinput [2:0] a, \n\tinput [2:0] b, \n\toutput [2:0] out_or_bitwise,\n\toutput out_or_logical,\n\toutput [5:0] out_not\n);\n\nassign out_or_bitwise = a | b;\nassign out_or_logical = |(a | b);\nassign out_not = {~b, ~a};\n\nendmodule\n", "module top_module(\n\tinput [2:0] a, \n\tinput [2:0] b, \n\toutput [2:0] out_or_bitwise,\n\toutput out_or_logical,\n\toutput [5:0] out_not\n);\n\nassign out_or_bitwise = a | b;\nassign out_or_logical = |(a) | |(b);\nassign o
{"task_id": "fsm3onehot", "llmgen_RTL": ["module top_module (\n\tinput in,\n\tinput [3:0] state,\n\toutput reg [3:0] next_state,\n\toutput out\n);\n\nalways @(*) begin\n\tcase (state)\n\t\t4'b0001: next_state = (in) ? 4'b0010 : 4'b0001; // State A\n\t\t4'b0010: next_state = (in) ? 4'b0010 : 4'b0100; // State B\n\t\t4'b0100: next_state = (in) ? 4'b1000 : 4'b0001; // State C\n\t\t4'b1000: next_state = (in) ? 4'b0010 : 4'b0100; // State D\n\t\tdefault: next_state = 4'b0001; // Reset to State A\n\tendcase\nend\n\nassign out = (state == 4'b1000) ? 1 : 0; // Output logic for State D\n\nendmodule\n", "module top_module (\n\tinput in,\n\tinput [3:0] state,\n\toutput reg [3:0] next_state,\n\toutput out\n);\n\nalways @(*) begin\n\tcase (state)\n\t\t4'b0001: // State A\n\t\t\tif (in)\n\t\t\t\tnext_state = 4'b0010; // Next state B\n\t\t\telse\n\t\t\t\tnext_state = 4'b0001; // Remain in A\n\t\t4'b0010: // State B\n\t\t\tif (in)\n\t\t\t\tnext_state = 4'b0010; // Remain in B\n\t\t\telse\n\t\t\t\tnext_state = 4'b0100; // Next state C\n\t\t4'b0100: // State C\n\t\t\tif (in)\n\t\t\t\tnext_state = 4'b1000; // Next state D\n\t\t\telse\n\t\t\t\tnext_state = 4'b0001; // Next state A\n\t\t4'b1000: // State D\n\t\t\tif (in)\n\t\t\t\tnext_state = 4'b0100; // Next state C\n\t\t\telse\n\t\t\t\tnext_state = 4'b0010; // Next state B\n\t\tdefault:\n\t\t\tnext_state = 4'b0001; // Reset to State A\n\tendcase\nend\n\nassign out = (state == 4'b1000) ? 1 : 0; // Output logic\n\nendmodule\n", "module top_module (\n input in,\n input [3:0] state,\n output reg [3:0] next_state,\n output out\n);\n \n always @(*) begin\n case (1'b1) // Check which state is active\n state[0]: begin // State A\n next_state = in ? 4'b0010 : 4'b0001; // A -> A or A -> B\n out = 1'b0;\n end\n state[1]: begin // State B\n next_state = in ? 4'b0010 : 4'b0100; // B -> B or B -> C\n out = 1'b0;\n end\n state[2]: begin // State C\n next_state = in ? 4'b1000 : 4'b0001; // C -> D or C -> A\n out = 1'b0;\n end\n state[3]: begin // State D\n next_state = in ? 4'b0100 : 4'b0010; // D -> C or D -> B\n out = 1'b1;\n end\n default: begin\n next_state = 4'b0001; // Default to state A\n out = 1'b0;\n end\n endcase\n end\n\nendmodule\n", "module top_module (\n input in,\n input [3:0] state,\n output reg [3:0] next_state,\n output out\n);\n\n always @(*) begin\n case (state)\n 4'b0001: // State A\n if (in)\n next_state = 4'b0010; // Transition to B\n else\n next_state = 4'b0001; // Stay in A\n 4'b0010: // State B\n if (in)\n next_state = 4'b0010; // Stay in B\n else\n next_state = 4'b0100; // Transition to C\n 4'b0100: // State C\n if (in)\n next_state = 4'b1000; // Transition to D\n else\n next_state = 4'b0001; // Transition to A\n 4'b1000: // State D\n if (in)\n next_state = 4'b0100; // Transition to C\n else\n next_state = 4'b0010; // Transition to B\n default: \n next_state = 4'b0001; // Default to State A\n endcase\n end\n\n assign out = (state == 4'b1000) ? 1'b1 : 1'b0; // Output logic\n\nendmodule\n", "module top_module (\n input in,\n input [3:0] state,\n output reg [3:0] next_state,\n output out\n);\n\nalways @(*) begin\n case (state)\n 4'b0001: next_state = (in) ? 4'b0010 : 4'b0001; // A\n 4'b0010: next_state = (in) ? 4'b0010 : 4'b0100; // B\n 4'b0100: next_state = (in) ? 4'b1000 : 4'b0001; // C\n 4'b1000: next_state = (in) ? 4'b0010 : 4'b0100; // D\n default: next_state = 4'b000
{"task_id": "conditional", "llmgen_RTL": ["module top_module (\n\tinput [7:0] a,\n\tinput [7:0] b,\n\tinput [7:0] c,\n\tinput [7:0] d,\n\toutput reg [7:0] min\n);\n\nalways @* begin\n\tif (a <= b && a <= c && a <= d) \n\t\tmin = a;\n\telse if (b <= a && b <= c && b <= d) \n\t\tmin = b;\n\telse if (c <= a && c <= b && c <= d) \n\t\tmin = c;\n\telse \n\t\tmin = d;\nend\n\nendmodule\n", "module top_module (\n\tinput [7:0] a,\n\tinput [7:0] b,\n\tinput [7:0] c,\n\tinput [7:0] d,\n\toutput reg [7:0] min\n);\n\nalways @* begin\n min = a; // Assume a is the minimum initially\n if (b < min) min = b;\n if (c < min) min = c;\n if (d < min) min = d;\nend\n\nendmodule\n", "module top_module (\n input [7:0] a,\n input [7:0] b,\n input [7:0] c,\n input [7:0] d,\n output reg [7:0] min\n);\n always @* begin\n min = a; // Assume a is the minimum initially\n if (b < min) min = b;\n if (c < min) min = c;\n if (d < min) min = d;\n end\nendmodule\n", "module top_module (\n input [7:0] a,\n input [7:0] b,\n input [7:0] c,\n input [7:0] d,\n output reg [7:0] min\n);\n\nalways @* begin\n min = a; // Initialize min to a\n if(b < min) min = b; // Compare with b\n if(c < min) min = c; // Compare with c\n if(d < min) min = d; // Compare with d\nend\n\nendmodule\n", "module top_module (\n\tinput [7:0] a,\n\tinput [7:0] b,\n\tinput [7:0] c,\n\tinput [7:0] d,\n\toutput reg [7:0] min\n);\n\n\talways @(*) begin\n\t\tmin = a; // Initialize min to a\n\t\tif (b < min) min = b; // Compare b with current min\n\t\tif (c < min) min = c; // Compare c with current min\n\t\tif (d < min) min = d; // Compare d with current min\n\tend\n\nendmodule\n", "module top_module (\n\tinput [7:0] a,\n\tinput [7:0] b,\n\tinput [7:0] c,\n\tinput [7:0] d,\n\toutput reg [7:0] min\n);\n\nalways @* begin\n\tmin = a; // Start with the assumption that 'a' is the minimum\n\tif (b < min) min = b; // Compare with 'b'\n\tif (c < min) min = c; // Compare with 'c'\n\tif (d < min) min = d; // Compare with 'd'\nend\n\nendmodule\n", "module top_module (\n\tinput [7:0] a,\n\tinput [7:0] b,\n\tinput [7:0] c,\n\tinput [7:0] d,\n\toutput reg [7:0] min\n);\n\nalways @* begin\n\tif (a < b) begin\n\t\tif (a < c) begin\n\t\t\tif (a < d) \n\t\t\t\tmin = a;\n\t\t\telse \n\t\t\t\tmin = d;\n\t\tend else begin\n\t\t\tif (c < d) \n\t\t\t\tmin = c;\n\t\t\telse \n\t\t\t\tmin = d;\n\t\tend\n\tend else begin\n\t\tif (b < c) begin\n\t\t\tif (b < d) \n\t\t\t\tmin = b;\n\t\t\telse \n\t\t\t\tmin = d;\n\t\tend else begin\n\t\t\tif (c < d) \n\t\t\t\tmin = c;\n\t\t\telse \n\t\t\t\tmin = d;\n\t\tend\n\tend\nend\n\nendmodule\n", "module top_module (\n input [7:0] a,\n input [7:0] b,\n input [7:0] c,\n input [7:0] d,\n output reg [7:0] min\n);\n always @* begin\n min = a; // Start by assuming a is the minimum\n if (b < min) min = b; // Compare with b\n if (c < min) min = c; // Compare with c\n if (d < min) min = d; // Compare with d\n end\nendmodule\n", "module top_module (\n input [7:0] a,\n input [7:0] b,\n input [7:0] c,\n input [7:0] d,\n output reg [7:0] min\n);\n always @(*) begin\n min = a; // Assume a is the minimum initially\n if (b < min) min = b;\n if (c < min) min = c;\n if (d < min) min = d;\n end\nendmodule\n", "module top_module (\n\tinput [7:0] a,\n\tinput [7:0] b,\n\tinput [7:0] c,\n\tinput [7:0] d,\n\toutput reg [7:0] min\n);\n\nalways @(*) begin\n\tif (a <= b && a <= c && a <= d)\n\t\tmin = a;\n\telse if (b <= a && b <= c && b <= d)\n\t\tmin = b;\n\telse if (c <= a && c <= b && c <= d)\n\t\tmin = c;\n\telse\n\t\tmin = d;\nend\n\nendmodule\n", "module top_module (\n input [7:0] a,\n input [7:0] b,\n input [7:0] c,\n input [7:0] d,\n output reg [7:0] min\n);\n\n always @(*) begin\n min = a; // Assume a is the minimum initially\n if (b < min) min = b;\n if (c < min) min = c;\n if (d < min) min = d;\n end\n\nendmodule\n", "module top_module (\n\tinput [7:0] a,\n\tinput [7:0
{"task_id": "gates", "llmgen_RTL": ["module top_module (\n input a,\n input b,\n output out_and,\n output out_or,\n output out_xor,\n output out_nand,\n output out_nor,\n output out_xnor,\n output out_anotb\n);\n\nassign out_and = a & b;\nassign out_or = a | b;\nassign out_xor = a ^ b;\nassign out_nand = ~(a & b);\nassign out_nor = ~(a | b);\nassign out_xnor = ~(a ^ b);\nassign out_anotb = a & ~b;\n\nendmodule\n", "module top_module (\n\tinput a,\n\tinput b,\n\toutput out_and,\n\toutput out_or,\n\toutput out_xor,\n\toutput out_nand,\n\toutput out_nor,\n\toutput out_xnor,\n\toutput out_anotb\n);\n\nassign out_and = a & b;\nassign out_or = a | b;\nassign out_xor = a ^ b;\nassign out_nand = ~(a & b);\nassign out_nor = ~(a | b);\nassign out_xnor = ~(a ^ b);\nassign out_anotb = a & ~b;\n\nendmodule\n", "module top_module (\n\tinput a,\n\tinput b,\n\toutput out_and,\n\toutput out_or,\n\toutput out_xor,\n\toutput out_nand,\n\toutput out_nor,\n\toutput out_xnor,\n\toutput out_anotb\n);\n\nassign out_and = a & b;\nassign out_or = a | b;\nassign out_xor = a ^ b;\nassign out_nand = ~(a & b);\nassign out_nor = ~(a | b);\nassign out_xnor = ~(a ^ b);\nassign out_anotb = a & ~b;\n\nendmodule\n", "module top_module (\n\tinput a,\n\tinput b,\n\toutput out_and,\n\toutput out_or,\n\toutput out_xor,\n\toutput out_nand,\n\toutput out_nor,\n\toutput out_xnor,\n\toutput out_anotb\n);\n\nassign out_and = a & b;\nassign out_or = a | b;\nassign out_xor = a ^ b;\nassign out_nand = ~(a & b);\nassign out_nor = ~(a | b);\nassign out_xnor = ~(a ^ b);\nassign out_anotb = a & ~b;\n\nendmodule\n", "module top_module (\n\tinput a,\n\tinput b,\n\toutput out_and,\n\toutput out_or,\n\toutput out_xor,\n\toutput out_nand,\n\toutput out_nor,\n\toutput out_xnor,\n\toutput out_anotb\n);\n\nassign out_and = a & b;\nassign out_or = a | b;\nassign out_xor = a ^ b;\nassign out_nand = ~(a & b);\nassign out_nor = ~(a | b);\nassign out_xnor = ~(a ^ b);\nassign out_anotb = a & ~b;\n\nendmodule\n", "module top_module (\n\tinput a,\n\tinput b,\n\toutput out_and,\n\toutput out_or,\n\toutput out_xor,\n\toutput out_nand,\n\toutput out_nor,\n\toutput out_xnor,\n\toutput out_anotb\n);\n\n\tassign out_and = a & b;\n\tassign out_or = a | b;\n\tassign out_xor = a ^ b;\n\tassign out_nand = ~(a & b);\n\tassign out_nor = ~(a | b);\n\tassign out_xnor = ~(a ^ b);\n\tassign out_anotb = a & ~b;\n\nendmodule\n", "module top_module (\n\tinput a,\n\tinput b,\n\toutput out_and,\n\toutput out_or,\n\toutput out_xor,\n\toutput out_nand,\n\toutput out_nor,\n\toutput out_xnor,\n\toutput out_anotb\n);\n\nassign out_and = a & b;\nassign out_or = a | b;\nassign out_xor = a ^ b;\nassign out_nand = ~(a & b);\nassign out_nor = ~(a | b);\nassign out_xnor = ~(a ^ b);\nassign out_anotb = a & ~b;\n\nendmodule\n", "module top_module (\n\tinput a,\n\tinput b,\n\toutput out_and,\n\toutput out_or,\n\toutput out_xor,\n\toutput out_nand,\n\toutput out_nor,\n\toutput out_xnor,\n\toutput out_anotb\n);\n\n\tassign out_and = a & b;\n\tassign out_or = a | b;\n\tassign out_xor = a ^ b;\n\tassign out_nand = ~(a & b);\n\tassign out_nor = ~(a | b);\n\tassign out_xnor = ~(a ^ b);\n\tassign out_anotb = a & ~b;\n\nendmodule\n", "module top_module (\n input a,\n input b,\n output out_and,\n output out_or,\n output out_xor,\n output out_nand,\n output out_nor,\n output out_xnor,\n output out_anotb\n);\n\nassign out_and = a & b;\nassign out_or = a | b;\nassign out_xor = a ^ b;\nassign out_nand = ~(a & b);\nassign out_nor = ~(a | b);\nassign out_xnor = ~(a ^ b);\nassign out_anotb = a & ~b;\n\nendmodule\n", "module top_module (\n input a,\n input b,\n output out_and,\n output out_or,\n output out_xor,\n output out_nand,\n output out_nor,\n output out_xnor,\n output out_anotb\n);\n\n assign out_and = a & b;\n assign out_or = a | b;\n assign out_xor = a ^ b;\n assign out_nand = ~(a & b);\n assign out_nor = ~(a | b);\n assign out_xnor = ~(a ^ b);\n assign out_anotb = a & ~b;\n\nendmodule\n", "module top_module (\n input a,\n
{"task_id": "kmap2", "llmgen_RTL": ["module top_module (\n\tinput a, \n\tinput b,\n\tinput c,\n\tinput d,\n\toutput out\n);\n\nassign out = ( ~c & ~d & (a | b) ) | ( ~c & d & a ) | ( c & b & d ) | ( c & ~b & ~d );\n\nendmodule\n", "module top_module (\n input a, \n input b,\n input c,\n input d,\n output out\n);\n assign out = ( ~a & ~b & d ) | ( ~a & c ) | ( a & ~b & ~c ) | ( a & b & c ) | ( b & c & d );\nendmodule\n", "module top_module (\n input a, \n input b,\n input c,\n input d,\n output out\n);\n\nassign out = (c == 0 && d == 0 && (a || b)) || \n (c == 1 && d == 1 && (b || !a)) || \n (c == 1 && d == 0 && (a || !b)) || \n (c == 0 && d == 1 && (b || !a));\n\nendmodule\n", "module top_module (\n input a, \n input b,\n input c,\n input d,\n output out\n);\n\nassign out = (c & ~d & (a | b)) | (c & d & (a | ~b)) | (~c & d & (~a | b)) | (~c & ~d & (a | ~b));\n\nendmodule\n", "module top_module (\n input a, \n input b,\n input c,\n input d,\n output out\n);\n assign out = (d == 0 && ((c == 0 && (a || b)) || (c == 1 && !b))) || \n (d == 1 && (c == 0 && a) || (c == 1 && b) || (c == 1 && !a && !b) || (c == 0 && !a && b));\nendmodule\n", "module top_module (\n\tinput a, \n\tinput b,\n\tinput c,\n\tinput d,\n\toutput out\n);\n\n\tassign out = (c == 0 && d == 0 && (a || b)) || \n\t (c == 0 && d == 1 && (a && !b)) || \n\t (c == 1 && d == 0 && (!a && b)) || \n\t (c == 1 && d == 1 && (a || (!b && !d))) || \n\t (c == 0 && d == 0 && b) || \n\t (c == 1 && d == 1 && b);\n\nendmodule\n", "module top_module (\n\tinput a, \n\tinput b,\n\tinput c,\n\tinput d,\n\toutput out\n);\n\nassign out = ( ~a & ~b & ~c & ~d ) | ( ~a & ~b & d ) | ( ~a & c & d ) | ( ~b & c & ~d ) | ( b & c & d ) | ( a & ~b & ~c );\n\nendmodule\n", "module top_module (\n\tinput a, \n\tinput b,\n\tinput c,\n\tinput d,\n\toutput out\n);\n assign out = (c ~^ d) & (a | b) | (c & ~d & a) | (b & ~a & d);\nendmodule\n", "module top_module (\n input a, \n input b,\n input c,\n input d,\n output out\n);\n assign out = (c & ~d & ~a) | (c & d & b) | (a & ~b & d) | (a & b & ~c) | (a & b & c);\nendmodule\n", "module top_module (\n input a, \n input b,\n input c,\n input d,\n output out\n);\n assign out = (~c & ~d & (a | b)) | \n (c & ~d & (b | ~a)) | \n (c & d & (a | b)) | \n (~b & d & (~a | c));\nendmodule\n", "module top_module (\n\tinput a, \n\tinput b,\n\tinput c,\n\tinput d,\n\toutput out\n);\n\tassign out = ( ~a & ~b & ~c & ~d ) | ( ~a & ~b & d ) | ( ~a & c & d ) | ( b & c ) | ( b & ~a & ~d );\nendmodule\n", "module top_module (\n\tinput a, \n\tinput b,\n\tinput c,\n\tinput d,\n\toutput out\n);\n\nassign out = ( ~c & ~d & (a | b) ) | ( ~c & d & a ) | ( c & b & (a | ~b) ) | ( c & ~b & d );\n\nendmodule\n", "module top_module (\n\tinput a, \n\tinput b,\n\tinput c,\n\tinput d,\n\toutput out\n);\n\nassign out = ( ~b & ~d ) | ( ~a & c & d ) | ( a & b & ~c ) | ( b & ~c & ~d );\n\nendmodule\n", "module top_module (\n input a, \n input b,\n input c,\n input d,\n output out\n);\n\nassign out = ( (~a & ~b & ~c & ~d) | // 00 00\n (~a & ~b & d) | // 00 10\n (~a & b & ~c & ~d) | // 01 00\n (~a & b & d) | // 01 10\n ( a & b & c & d) | // 11 11\n ( a & b & ~c & d) | // 11 10\n ( a & ~b & ~c & ~d) ); // 10 00\n\nendmodule\n", "module top_module (\n input a, \n input b,\n input c,\n input d,\n output out\n);\n assign out = (c & ~d & ~b & ~a) | (c & d & b & ~a) | (c & ~d & b & a) | (d & ~c & b & a) | (c & d & ~b & a);\nendmodule\n", "module top_module (\n\tinput a, \n\tinput b,\n\tinput c,\n\tinput d,\n\toutput out\n);\n\n\tassign out = ( ~a & ~b & ~c & d ) | ( ~a & b & ~c & d ) | ( ~a & ~b & c & ~d ) | ( a & b & ~c & ~d ) | ( a & ~b & c & d ) | ( a & b & c & ~d ) | ( a & b & c & d );\n\nendmodule\n
{"task_id": "2014_q3fsm", "llmgen_RTL": ["module top_module (\n input clk,\n input reset,\n input s,\n input w,\n output reg z\n);\n\n typedef enum reg [1:0] {A, B} state_t; // State encoding\n state_t current_state, next_state;\n reg [2:0] w_count;\n\n always @(posedge clk) begin\n if (reset) begin\n current_state <= A;\n z <= 0;\n w_count <= 0;\n end else begin\n current_state <= next_state;\n if (current_state == B) begin\n if (w == 1) w_count <= w_count + 1;\n else w_count <= w_count; // Do not increment count when w is 0\n end else begin\n w_count <= 0; // Reset count in state A\n end\n \n if (next_state == B && w_count == 3) begin\n z <= (w_count == 2) ? 1 : 0;\n end else begin\n z <= 0; // Reset output in other conditions\n end\n end\n end\n\n always @* begin\n case (current_state)\n A: begin\n if (s) next_state = B; // Transition to state B\n else next_state = A; // Remain in state A\n end\n B: begin\n if (w_count < 3) next_state = B; // Stay in state B\n else next_state = A; // Return to state A after 3 cycles\n end\n default: next_state = A; // Default state\n endcase\n end\nendmodule\n", "module top_module (\n input clk,\n input reset,\n input s,\n input w,\n output reg z\n);\n typedef enum reg [1:0] {A, B} state_t;\n state_t current_state, next_state;\n reg [1:0] w_count;\n\n always @(posedge clk) begin\n if (reset) begin\n current_state <= A;\n z <= 0;\n w_count <= 0;\n end else begin\n current_state <= next_state;\n if (current_state == B) begin\n z <= (w_count == 2);\n end\n end\n end\n\n always @* begin\n next_state = current_state;\n case (current_state)\n A: begin\n if (s == 1) begin\n next_state = B;\n w_count = 0;\n end\n end\n B: begin\n w_count = w_count + (w ? 1 : 0);\n // Stay in B for the next 2 cycles\n if (w_count == 2) begin\n next_state = B; // can keep counting in the next cycles\n } else if (w_count > 2) begin\n w_count = 2; // cap at 2\n end\n end\n endcase\n end\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput reset,\n\tinput s,\n\tinput w,\n\toutput reg z\n);\n\ntypedef enum reg [1:0] {\n\tA = 2'b00,\n\tB = 2'b01\n} state_t;\n\nstate_t current_state, next_state;\nreg [1:0] count_w;\n\nalways @(posedge clk) begin\n\tif (reset) begin\n\t\tcurrent_state <= A;\n\t\tcount_w <= 0;\n\t\tz <= 0;\n\tend else begin\n\t\tcurrent_state <= next_state;\n\tend\nend\n\nalways @* begin\n\tnext_state = current_state;\n\tcase (current_state)\n\t\tA: begin\n\t\t\tcount_w = 0;\n\t\t\tz = 0;\n\t\t\tif (s) begin\n\t\t\t\tnext_state = B;\n\t\t\tend\n\t\tend\n\t\tB: begin\n\t\t\tif (count_w < 3) begin\n\t\t\t\tif (w) begin\n\t\t\t\t\tcount_w = count_w + 1;\n\t\t\t\tend\n\t\t\tend else begin\n\t\t\t\tif (count_w == 2) begin\n\t\t\t\t\tz = 1;\n\t\t\t\tend else begin\n\t\t\t\t\tz = 0;\n\t\t\t\tend\n\t\t\t\tnext_state = B; // Continue in state B\n\t\t\tend\n\t\tend\n\tendcase\nend\n\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput reset,\n\tinput s,\n\tinput w,\n\toutput reg z\n);\n\n typedef enum reg [1:0] {\n A = 2'b00,\n B = 2'b01,\n COUNT_0 = 2'b10,\n COUNT_1 = 2'b11\n } state_t;\n \n state_t current_state, next_state;\n reg [2:0] count_w; // Count number of w = 1 in 3 cycles\n \n always @(posedge clk) begin\n if (reset) begin\n current_state <= A;\n
{"task_id": "vector4", "llmgen_RTL": ["module top_module (\n\tinput [7:0] in,\n\toutput [31:0] out\n);\n assign out = { {24{in[7]}}, in };\nendmodule\n", "module top_module (\n\tinput [7:0] in,\n\toutput [31:0] out\n);\n\tassign out = { {24{in[7]}}, in };\nendmodule\n", "module top_module (\n input [7:0] in,\n output [31:0] out\n);\n assign out = { {24{in[7]}}, in };\nendmodule\n", "module top_module (\n\tinput [7:0] in,\n\toutput [31:0] out\n);\n\tassign out = { {24{in[7]}}, in };\nendmodule\n", "module top_module (\n\tinput [7:0] in,\n\toutput [31:0] out\n);\n assign out = { {24{in[7]}}, in };\nendmodule\n", "module top_module (\n\tinput [7:0] in,\n\toutput [31:0] out\n);\n\tassign out = { {24{in[7]}}, in };\nendmodule\n", "module top_module (\n\tinput [7:0] in,\n\toutput [31:0] out\n);\n\tassign out = { {24{in[7]}}, in };\nendmodule\n", "module top_module (\n\tinput [7:0] in,\n\toutput [31:0] out\n);\n\tassign out = { {24{in[7]}}, in };\nendmodule\n", "module top_module (\n\tinput [7:0] in,\n\toutput [31:0] out\n);\n\tassign out = { {24{in[7]}}, in };\nendmodule\n", "module top_module (\n\tinput [7:0] in,\n\toutput [31:0] out\n);\n\tassign out = { {24{in[7]}}, in };\nendmodule\n", "module top_module (\n\tinput [7:0] in,\n\toutput [31:0] out\n);\n\tassign out = { {24{in[7]}}, in };\nendmodule\n", "module top_module (\n\tinput [7:0] in,\n\toutput [31:0] out\n);\n\tassign out = { {24{in[7]}}, in };\nendmodule\n", "module top_module (\n input [7:0] in,\n output [31:0] out\n);\n assign out = { {24{in[7]}}, in };\nendmodule\n", "module top_module (\n\tinput [7:0] in,\n\toutput [31:0] out\n);\n\tassign out = { {24{in[7]}}, in };\nendmodule\n", "module top_module (\n\tinput [7:0] in,\n\toutput [31:0] out\n);\n\tassign out = { {24{in[7]}}, in };\nendmodule\n", "module top_module (\n input [7:0] in,\n output [31:0] out\n);\n assign out = { {24{in[7]}}, in };\nendmodule\n", "module top_module (\n input [7:0] in,\n output [31:0] out\n);\n assign out = { {24{in[7]}}, in };\nendmodule\n", "module top_module (\n input [7:0] in,\n output [31:0] out\n);\n assign out = { {24{in[7]}}, in };\nendmodule\n", "module top_module (\n input [7:0] in,\n output [31:0] out\n);\n assign out = { {24{in[7]}}, in };\nendmodule\n", "module top_module (\n input [7:0] in,\n output [31:0] out\n);\n assign out = { {24{in[7]}}, in };\nendmodule\n"]}
{"task_id": "m2014_q4k", "llmgen_RTL": ["module top_module (\n input clk,\n input resetn,\n input in,\n output out\n);\n reg [3:0] shift_reg;\n\n always @(posedge clk) begin\n if (!resetn) begin\n shift_reg <= 4'b0000;\n end else begin\n shift_reg <= {shift_reg[2:0], in};\n end\n end\n\n assign out = shift_reg[3];\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput resetn,\n\tinput in,\n\toutput out\n);\n\treg [3:0] shift_reg;\n\n\talways @(posedge clk) begin\n\t\tif (!resetn) begin\n\t\t\tshift_reg <= 4'b0000;\n\t\tend else begin\n\t\t\tshift_reg <= {shift_reg[2:0], in};\n\t\tend\n\tend\n\n\tassign out = shift_reg[3];\nendmodule\n", "module top_module (\n input clk,\n input resetn,\n input in,\n output out\n);\n reg [3:0] shift_reg;\n\n always @(posedge clk) begin\n if (!resetn) begin\n shift_reg <= 4'b0000;\n end else begin\n shift_reg <= {shift_reg[2:0], in};\n end\n end\n\n assign out = shift_reg[3];\nendmodule\n", "module top_module (\n input clk,\n input resetn,\n input in,\n output out\n);\n reg [3:0] shift_reg;\n\n always @(posedge clk) begin\n if (~resetn) begin\n shift_reg <= 4'b0000;\n end else begin\n shift_reg <= {shift_reg[2:0], in};\n end\n end\n\n assign out = shift_reg[3];\nendmodule\n", "module top_module (\n input clk,\n input resetn,\n input in,\n output out\n);\n reg [3:0] shift_reg;\n\n always @(posedge clk) begin\n if (!resetn) \n shift_reg <= 4'b0000;\n else \n shift_reg <= {shift_reg[2:0], in};\n end\n\n assign out = shift_reg[3];\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput resetn,\n\tinput in,\n\toutput out\n);\n\treg [3:0] shift_reg;\n\tassign out = shift_reg[3];\n\n\talways @(posedge clk) begin\n\t\tif (!resetn) begin\n\t\t\tshift_reg <= 4'b0000;\n\t\tend else begin\n\t\t\tshift_reg <= {shift_reg[2:0], in};\n\t\tend\n\tend\nendmodule\n", "module top_module (\n input clk,\n input resetn,\n input in,\n output out\n);\n\n reg [3:0] shift_reg;\n\n always @(posedge clk) begin\n if (!resetn) begin\n shift_reg <= 4'b0000;\n end else begin\n shift_reg <= {shift_reg[2:0], in};\n end\n end\n\n assign out = shift_reg[3];\n\nendmodule\n", "module top_module (\n input clk,\n input resetn,\n input in,\n output out\n);\n reg [3:0] shift_reg;\n\n always @(posedge clk) begin\n if (!resetn) begin\n shift_reg <= 4'b0000;\n end else begin\n shift_reg <= {shift_reg[2:0], in};\n end\n end\n\n assign out = shift_reg[3];\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput resetn,\n\tinput in,\n\toutput out\n);\n\treg [3:0] shift_reg;\n\n\talways @(posedge clk) begin\n\t\tif (~resetn) begin\n\t\t\tshift_reg <= 4'b0000;\n\t\tend else begin\n\t\t\tshift_reg <= {shift_reg[2:0], in};\n\t\tend\n\tend\n\n\tassign out = shift_reg[3];\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput resetn,\n\tinput in,\n\toutput out\n);\n\treg [3:0] shift_reg;\n\n\talways @(posedge clk) begin\n\t\tif (~resetn) begin\n\t\t\tshift_reg <= 4'b0000;\n\t\tend else begin\n\t\t\tshift_reg <= {shift_reg[2:0], in};\n\t\tend\n\tend\n\n\tassign out = shift_reg[3];\n\nendmodule\n", "module top_module (\n input clk,\n input resetn,\n input in,\n output out\n);\n\n reg [3:0] shift_reg;\n\n always @(posedge clk) begin\n if (!resetn) begin\n shift_reg <= 4'b0000;\n end else begin\n shift_reg <= {shift_reg[2:0], in};\n end\n end\n\n assign out = shift_reg[3];\n\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput resetn,\n\tinput in,\n\toutput out\n);\n reg [3:0] shift_reg;\n\n always @(posedge clk) begin\n if (!resetn) begin\n shift_reg <= 4'b0000;\n end else begin\n shift_reg <= {shift_reg[2:0], in};\n end\n
{"task_id": "always_case2", "llmgen_RTL": ["module top_module (\n input [3:0] in,\n output reg [1:0] pos\n);\n always @(*) begin\n case (in)\n 4'b0000: pos = 2'b00; // No input high\n 4'b0001: pos = 2'b00; // Bit 0\n 4'b0010: pos = 2'b01; // Bit 1\n 4'b0100: pos = 2'b10; // Bit 2\n 4'b1000: pos = 2'b11; // Bit 3\n 4'b0011: pos = 2'b00; // Bit 0 or Bit 1\n 4'b0110: pos = 2'b01; // Bit 1 or Bit 2\n 4'b1100: pos = 2'b10; // Bit 2 or Bit 3\n 4'b0101: pos = 2'b10; // Bit 2 or Bit 0\n 4'b1001: pos = 2'b00; // Bit 0 or Bit 3\n 4'b1010: pos = 2'b11; // Bit 3 or Bit 0\n 4'b0111: pos = 2'b01; // Bit 1, Bit 2 or Bit 3\n 4'b1110: pos = 2'b11; // Bit 3, Bit 2 or Bit 1\n 4'b1101: pos = 2'b00; // Bit 0, Bit 3 or Bit 2 \n 4'b1011: pos = 2'b10; // Bit 2, Bit 3 or Bit 1\n 4'b1111: pos = 2'b00; // All high, take the first: Bit 0\n default: pos = 2'b00; // Fallback case, should not be reached\n endcase\n end\nendmodule\n", "module top_module (\n\tinput [3:0] in,\n\toutput reg [1:0] pos\n);\n\talways @(*) begin\n\t\tcasex (in)\n\t\t\t4'b1xxx: pos = 2'd3; // in[3]\n\t\t\t4'b01xx: pos = 2'd2; // in[2]\n\t\t\t4'b001x: pos = 2'd1; // in[1]\n\t\t\t4'b0001: pos = 2'd0; // in[0]\n\t\t\tdefault: pos = 2'd0; // No input high\n\t\tendcase\n\tend\nendmodule\n", "module top_module (\n\tinput [3:0] in,\n\toutput reg [1:0] pos\n);\n\n\talways @(*) begin\n\t\tcase (in)\n\t\t\t4'b0001: pos = 2'd0;\n\t\t\t4'b0010: pos = 2'd1;\n\t\t\t4'b0100: pos = 2'd2;\n\t\t\t4'b1000: pos = 2'd3;\n\t\t\tdefault: pos = 2'b00;\n\t\tendcase\n\tend\nendmodule\n", "module top_module (\n input [3:0] in,\n output reg [1:0] pos\n);\n \n always @(*) begin\n case (in)\n 4'b0000: pos = 2'b00; // No input is high\n 4'b0001: pos = 2'b00; // Output position of first '1'\n 4'b0010: pos = 2'b01; // Output position of first '1'\n 4'b0100: pos = 2'b10; // Output position of first '1'\n 4'b1000: pos = 2'b11; // Output position of first '1'\n 4'b0011: pos = 2'b00; // Output position of first '1'\n 4'b0110: pos = 2'b01; // Output position of first '1'\n 4'b1100: pos = 2'b10; // Output position of first '1'\n 4'b0111: pos = 2'b00; // Output position of first '1'\n 4'b1110: pos = 2'b01; // Output position of first '1'\n 4'b1111: pos = 2'b00; // Output position of first '1'\n default: pos = 2'b00; // Default case to handle don't care\n endcase\n end\n\nendmodule\n", "module top_module (\n input [3:0] in,\n output reg [1:0] pos\n);\n always @* begin\n case (in)\n 4'b0001: pos = 2'd0;\n 4'b0010: pos = 2'd1;\n 4'b0100: pos = 2'd2;\n 4'b1000: pos = 2'd3;\n 4'b0011: pos = 2'd1; // First 1-bit is at position 1\n 4'b0110: pos = 2'd2; // First 1-bit is at position 2\n 4'b1100: pos = 2'd2; // First 1-bit is at position 2\n 4'b1110: pos = 2'd2; // First 1-bit is at position 2\n 4'b1111: pos = 2'd3; // First 1-bit is at position 3\n default: pos = 2'd0; // No 1 bits, output zero\n endcase\n end\nendmodule\n", "module top_module (\n input [3:0] in,\n output reg [1:0] pos\n);\n always @(*) begin\n casez (in)\n 4'b1??? : pos = 2'd3;\n 4'b01?? : pos = 2'd2;\n 4'b001? : pos = 2'd1;\n 4'b0001 : pos = 2'd0;\n default : pos = 2'd0; // if none are high\n endcase\n end\nendmodule\n", "module top_module (\n input [3:0] in,\n output reg [1:0] pos\n);\n always @* begin\n casez (in)\n 4'b1??? : pos = 2'd0; // 1 at position 0\n 4'b01?? : pos = 2'd1; // 1 at position 1\n 4'b001? : pos = 2'd2; // 1 at position 2\n 4'b0001 : pos = 2'd3; // 1 at position 3\n default : pos = 2'
{"task_id": "fsm2", "llmgen_RTL": ["module top_module (\n input clk,\n input j,\n input k,\n input areset,\n output reg out\n);\n reg state; // 0 for OFF, 1 for ON\n \n always @(posedge clk or posedge areset) begin\n if (areset) begin\n state <= 0; // Reset to OFF state\n end else begin\n case (state)\n 0: begin // OFF state\n if (j == 1) state <= 1; // Transition to ON state\n end\n 1: begin // ON state\n if (k == 1) state <= 0; // Transition to OFF state\n end\n endcase\n end\n end\n\n always @(*) begin\n out = state; // Output is the current state\n end\nendmodule\n", "module top_module (\n input clk,\n input j,\n input k,\n input areset,\n output reg out\n);\n\n typedef enum reg [1:0] {OFF, ON} state_t;\n state_t state, next_state;\n\n always @(posedge clk or posedge areset) begin\n if (areset) begin\n state <= OFF;\n end else begin\n state <= next_state;\n end\n end\n\n always @* begin\n case (state)\n OFF: begin\n out = 0;\n if (j) begin\n next_state = ON;\n end else begin\n next_state = OFF;\n end\n end\n ON: begin\n out = 1;\n if (k) begin\n next_state = OFF;\n end else begin\n next_state = ON;\n end\n end\n default: begin\n next_state = OFF;\n end\n endcase\n end\n\nendmodule\n", "module top_module (\n input clk,\n input j,\n input k,\n input areset,\n output reg out\n);\n\n typedef enum reg [1:0] {OFF, ON} state_t;\n state_t state, next_state;\n\n always @(posedge clk or posedge areset) begin\n if (areset) begin\n state <= OFF;\n end else begin\n state <= next_state;\n end\n end\n\n always @(*) begin\n case (state)\n OFF: begin\n out = 0;\n if (j) \n next_state = ON; \n else \n next_state = OFF;\n end\n ON: begin\n out = 1;\n if (k) \n next_state = OFF; \n else \n next_state = ON;\n end\n default: next_state = OFF;\n endcase\n end\nendmodule\n", "module top_module (\n input clk,\n input j,\n input k,\n input areset,\n output reg out\n);\n\n typedef enum reg [1:0] {OFF, ON} state_t;\n state_t state, next_state;\n\n always @(posedge clk or posedge areset) begin\n if (areset) \n state <= OFF;\n else \n state <= next_state;\n end\n\n always @(*) begin\n case (state)\n OFF: begin\n out = 1'b0;\n if (j) \n next_state = ON;\n else \n next_state = OFF;\n end\n ON: begin\n out = 1'b1;\n if (k) \n next_state = OFF;\n else \n next_state = ON;\n end\n default: next_state = OFF; // default case\n endcase\n end\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput j,\n\tinput k,\n\tinput areset,\n\toutput reg out\n);\n \n\ttypedef enum reg [1:0] {OFF, ON} state_t;\n\tstate_t current_state, next_state;\n\n\t// Asynchronous reset and state transition\n\talways @(posedge clk or posedge areset) begin\n\t\tif (areset) begin\n\t\t\tcurrent_state <= OFF;\n\t\tend else begin\n\t\t\tcurrent_state <= next_state;\n\t\tend\n\tend\n\n\t// Next state logic\n\talways @(*) begin\n\t\tcase (current_state)\n\t\t\tOFF: begin\n\t\t\t\tif (j == 1)\n\t\t\t\t\tnext_state = ON;\n\t\t\t\tels
{"task_id": "m2014_q4i", "llmgen_RTL": ["module top_module(\n\toutput out);\n\tassign out = 0;\nendmodule\n", "module top_module(\n\toutput out);\n\n\tassign out = 0;\n\nendmodule\n", "module top_module(\n\toutput out);\n\tassign out = 1'b0;\nendmodule\n", "module top_module(\n\toutput out);\n\t\n\tassign out = 1'b0;\n\nendmodule\n", "module top_module(\n\toutput out);\n\tassign out = 1'b0;\nendmodule\n", "module top_module(\n\toutput out);\n\n\tassign out = 0;\n\nendmodule\n", "module top_module(\n\toutput out);\n\tassign out = 1'b0;\nendmodule\n", "module top_module(\n\toutput out);\n\tassign out = 1'b0;\nendmodule\n", "module top_module(\n\toutput out);\n\tassign out = 0;\nendmodule\n", "module top_module(\n\toutput out);\n\tassign out = 1'b0;\nendmodule\n", "module top_module(\n\toutput out);\n\n\tassign out = 1'b0;\n\nendmodule\n", "module top_module(\n\toutput out);\n\tassign out = 1'b0;\nendmodule\n", "module top_module(\n\toutput out);\n\tassign out = 1'b0;\nendmodule\n", "module top_module(\n\toutput out);\n \n\tassign out = 0;\n\nendmodule\n", "module top_module(\n\toutput out);\n\tassign out = 1'b0;\nendmodule\n", "module top_module(\n\toutput out);\n\n\tassign out = 1'b0;\n\nendmodule\n", "module top_module(\n\toutput out);\n\tassign out = 1'b0;\nendmodule\n", "module top_module(\n\toutput out);\n\tassign out = 1'b0;\nendmodule\n", "module top_module(\n\toutput out);\n\tassign out = 1'b0;\nendmodule\n", "module top_module(\n\toutput out);\n\tassign out = 1'b0;\nendmodule\n"]}
{"task_id": "step_one", "llmgen_RTL": ["module top_module(\n\toutput one);\n\n\tassign one = 1'b1;\n\nendmodule\n", "module top_module(\n\toutput one);\n\n\tassign one = 1'b1;\n\nendmodule\n", "module top_module(\n\toutput one);\n\tassign one = 1'b1;\nendmodule\n", "module top_module(\n\toutput one);\n\n\tassign one = 1;\n\nendmodule\n", "module top_module(\n\toutput one);\n \n\tassign one = 1'b1;\n\nendmodule\n", "module top_module(\n\toutput one);\n\tassign one = 1'b1;\nendmodule\n", "module top_module(\n\toutput one);\n\tassign one = 1'b1;\nendmodule\n", "module top_module(\n\toutput one);\n \n\tassign one = 1'b1;\n\nendmodule\n", "module top_module(\n output one);\n\nassign one = 1'b1;\n\nendmodule\n", "module top_module(\n\toutput one);\n\tassign one = 1'b1;\nendmodule\n", "module top_module(\n\toutput one);\n \n\tassign one = 1'b1;\n\nendmodule\n", "module top_module(\n\toutput one);\n\tassign one = 1'b1;\nendmodule\n", "module top_module(\n\toutput one);\n\t\n\tassign one = 1'b1;\n\nendmodule\n", "module top_module(\n\toutput one);\n\t\n\tassign one = 1'b1;\n\nendmodule\n", "module top_module(\n\toutput one);\n\tassign one = 1'b1;\nendmodule\n", "module top_module(\n\toutput one);\n\tassign one = 1'b1;\nendmodule\n", "module top_module(\n\toutput one);\n\n\tassign one = 1'b1;\n\nendmodule\n", "module top_module(\n\toutput one);\n\tassign one = 1'b1;\nendmodule\n", "module top_module(\n\toutput one);\n assign one = 1'b1;\nendmodule\n", "module top_module(\n\toutput one);\n\n\tassign one = 1'b1;\n\nendmodule\n"]}
{"task_id": "vector100r", "llmgen_RTL": ["module top_module (\n\tinput [99:0] in,\n\toutput reg [99:0] out\n);\n always @* begin\n out = {in[0], in[1], in[2], in[3], in[4], in[5], in[6], in[7], in[8], in[9],\n in[10], in[11], in[12], in[13], in[14], in[15], in[16], in[17], \n in[18], in[19], in[20], in[21], in[22], in[23], in[24], in[25], \n in[26], in[27], in[28], in[29], in[30], in[31], in[32], in[33], \n in[34], in[35], in[36], in[37], in[38], in[39], in[40], in[41], \n in[42], in[43], in[44], in[45], in[46], in[47], in[48], in[49], \n in[50], in[51], in[52], in[53], in[54], in[55], in[56], in[57], \n in[58], in[59], in[60], in[61], in[62], in[63], in[64], in[65], \n in[66], in[67], in[68], in[69], in[70], in[71], in[72], in[73], \n in[74], in[75], in[76], in[77], in[78], in[79], in[80], in[81], \n in[82], in[83], in[84], in[85], in[86], in[87], in[88], in[89], \n in[90], in[91], in[92], in[93], in[94], in[95], in[96], in[97], \n in[98], in[99]};\n end\nendmodule\n", "module top_module (\n input [99:0] in,\n output reg [99:0] out\n);\n always @* begin\n out = {in[0], in[1], in[2], in[3], in[4], in[5], in[6], in[7], in[8], in[9],\n in[10], in[11], in[12], in[13], in[14], in[15], in[16], in[17], \n in[18], in[19], in[20], in[21], in[22], in[23], in[24], in[25], \n in[26], in[27], in[28], in[29], in[30], in[31], in[32], in[33], \n in[34], in[35], in[36], in[37], in[38], in[39], in[40], in[41], \n in[42], in[43], in[44], in[45], in[46], in[47], in[48], in[49], \n in[50], in[51], in[52], in[53], in[54], in[55], in[56], in[57], \n in[58], in[59], in[60], in[61], in[62], in[63], in[64], in[65], \n in[66], in[67], in[68], in[69], in[70], in[71], in[72], in[73], \n in[74], in[75], in[76], in[77], in[78], in[79], in[80], in[81], \n in[82], in[83], in[84], in[85], in[86], in[87], in[88], in[89], \n in[90], in[91], in[92], in[93], in[94], in[95], in[96], in[97], \n in[98], in[99]};\n end\nendmodule\n", "module top_module (\n input [99:0] in,\n output reg [99:0] out\n);\n always @* begin\n out = {in[0], in[1], in[2], in[3], in[4], in[5], in[6], in[7], in[8], in[9], \n in[10], in[11], in[12], in[13], in[14], in[15], in[16], in[17], \n in[18], in[19], in[20], in[21], in[22], in[23], in[24], in[25], \n in[26], in[27], in[28], in[29], in[30], in[31], in[32], in[33], \n in[34], in[35], in[36], in[37], in[38], in[39], in[40], in[41], \n in[42], in[43], in[44], in[45], in[46], in[47], in[48], in[49], \n in[50], in[51], in[52], in[53], in[54], in[55], in[56], in[57], \n in[58], in[59], in[60], in[61], in[62], in[63], in[64], in[65], \n in[66], in[67], in[68], in[69], in[70], in[71], in[72], in[73], \n in[74], in[75], in[76], in[77], in[78], in[79], in[80], in[81], \n in[82], in[83], in[84], in[85], in[86], in[87], in[88], in[89], \n in[90], in[91], in[92], in[93], in[94], in[95], in[96], in[97], \n in[98], in[99]};\n end\nendmodule\n", "module top_module (\n input [99:0] in,\n output reg [99:0] out\n);\n\n always @(*) begin\n out = {in[0], in[1], in[2], in[3], in[4], in[5], in[6], in[7], in[8], in[9],\n in[10], in[11], in[12], in[13], in[14], in[15], in[16], in[17], in[18], in[19],\n in[20], in[21], in[22], in[23], in[24], in[25], in[26], in[27], in[28], in[29],\n in[30], in[31], in[32], in[33], in[34], in[35], in[36], in[37], in[38], in[39],\n in[40], in[41], in[42], in[43], in[44], in[45], in[46], in[47], in[48], in[49],\n in[50], in[51], in[52], in[53], in[54], in[55], in[56], in[57], in[58], in[59],\n
{"task_id": "m2014_q4d", "llmgen_RTL": ["module top_module (\n input clk,\n input in,\n output logic out\n);\n logic xor_output;\n\n // Two-input XOR\n assign xor_output = in ^ out;\n\n // D Flip-Flop\n always_ff @(posedge clk) begin\n out <= xor_output;\n end\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput in,\n\toutput logic out\n);\n logic xor_out;\n\n assign xor_out = in ^ out;\n\n always_ff @(posedge clk) begin\n out <= xor_out;\n end\nendmodule\n", "module top_module (\n input clk,\n input in,\n output logic out\n);\n logic xor_out;\n\n always_ff @(posedge clk) begin\n out <= xor_out;\n end\n\n assign xor_out = in ^ out;\n\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput in,\n\toutput logic out\n);\n logic d;\n\n // Two-input XOR\n assign d = in ^ out;\n\n // D flip-flop\n always_ff @(posedge clk) begin\n out <= d;\n end\nendmodule\n", "module top_module (\n input clk,\n input in,\n output logic out\n);\n logic d_ff_out;\n\n assign d = in ^ d_ff_out;\n\n always_ff @(posedge clk) begin\n d_ff_out <= d;\n end\n\n assign out = d_ff_out;\n\nendmodule\n", "module top_module (\n input clk,\n input in,\n output logic out\n);\n logic d;\n\n // XOR operation\n assign d = in ^ out;\n\n // D flip-flop\n always_ff @(posedge clk) begin\n out <= d;\n end\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput in,\n\toutput logic out\n);\n logic xor_out;\n\n always_ff @(posedge clk) begin\n out <= xor_out;\n end\n\n assign xor_out = in ^ out;\n\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput in,\n\toutput logic out\n);\n logic xor_out;\n\n always_ff @(posedge clk) begin\n out <= xor_out;\n end\n\n assign xor_out = in ^ out;\n\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput in,\n\toutput logic out\n);\n\nlogic xor_out;\n\nassign xor_out = in ^ out;\n\nalways_ff @(posedge clk) begin\n\tout <= xor_out;\nend\n\nendmodule\n", "module top_module (\n input clk,\n input in,\n output logic out\n);\n logic xor_out;\n\n assign xor_out = in ^ out;\n\n always_ff @(posedge clk) begin\n out <= xor_out;\n end\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput in,\n\toutput logic out\n);\n logic xor_out;\n\n assign xor_out = in ^ out;\n\n always_ff @(posedge clk) begin\n out <= xor_out;\n end\nendmodule\n", "module top_module (\n input clk,\n input in,\n output logic out\n);\n logic xor_out;\n\n always_ff @(posedge clk) begin\n out <= xor_out;\n end\n\n assign xor_out = in ^ out;\n\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput in,\n\toutput logic out\n);\n logic xor_out;\n\n always_ff @(posedge clk) begin\n out <= xor_out;\n end\n\n assign xor_out = in ^ out;\nendmodule\n", "module top_module (\n input clk,\n input in,\n output logic out\n);\n logic ff_out;\n\n always_ff @(posedge clk) begin\n ff_out <= in ^ ff_out;\n end\n\n assign out = ff_out;\n\nendmodule\n", "module top_module (\n input clk,\n input in,\n output logic out\n);\n logic xor_out;\n\n assign xor_out = in ^ out;\n\n always_ff @(posedge clk) begin\n out <= xor_out;\n end\nendmodule\n", "module top_module (\n input clk,\n input in,\n output logic out\n);\n logic xor_out;\n\n assign xor_out = in ^ out;\n\n always_ff @(posedge clk) begin\n out <= xor_out;\n end\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput in,\n\toutput logic out\n);\n logic xor_out;\n\n // Two-input XOR of 'in' and 'out'\n assign xor_out = in ^ out;\n\n // D flip-flop triggered on positive edge of clk\n always_ff @(posedge clk) begin\n out <= xor_out;\n end\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput in,\n\toutput logic out\n);\n logic xor_out;\n\n assign xor_out = in ^ out;\n\n always_ff @(posedge clk) begin\n o
{"task_id": "shift4", "llmgen_RTL": ["module top_module(\n input clk,\n input areset,\n input load,\n input ena,\n input [3:0] data,\n output reg [3:0] q\n);\n always @(posedge clk or posedge areset) begin\n if (areset) begin\n q <= 4'b0000;\n end else if (load) begin\n q <= data;\n end else if (ena) begin\n q <= {1'b0, q[3:1]};\n end\n end\nendmodule\n", "module top_module(\n input clk,\n input areset,\n input load,\n input ena,\n input [3:0] data,\n output reg [3:0] q\n);\n\n always @(posedge clk or posedge areset) begin\n if (areset) begin\n q <= 4'b0000;\n end else if (load) begin\n q <= data;\n end else if (ena) begin\n q <= {1'b0, q[3:1]};\n end\n end\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput areset,\n\tinput load,\n\tinput ena,\n\tinput [3:0] data,\n\toutput reg [3:0] q);\n\n\talways @(posedge clk or posedge areset) begin\n\t\tif (areset) begin\n\t\t\tq <= 4'b0000;\n\t\tend else if (load) begin\n\t\t\tq <= data;\n\t\tend else if (ena) begin\n\t\t\tq <= {1'b0, q[3:1]}; // Right shift\n\t\tend\n\tend\nendmodule\n", "module top_module(\n input clk,\n input areset,\n input load,\n input ena,\n input [3:0] data,\n output reg [3:0] q\n);\n\n always @(posedge clk or posedge areset) begin\n if (areset) begin\n q <= 4'b0000;\n end else if (load) begin\n q <= data;\n end else if (ena) begin\n q <= {1'b0, q[3:1]};\n end\n end\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput areset,\n\tinput load,\n\tinput ena,\n\tinput [3:0] data,\n\toutput reg [3:0] q\n);\n\nalways @(posedge clk or posedge areset) begin\n\tif (areset) begin\n\t\tq <= 4'b0000;\n\tend else if (load) begin\n\t\tq <= data;\n\tend else if (ena) begin\n\t\tq <= {1'b0, q[3:1]};\n\tend\nend\n\nendmodule\n", "module top_module(\n input clk,\n input areset,\n input load,\n input ena,\n input [3:0] data,\n output reg [3:0] q\n);\n \nalways @(posedge clk or posedge areset) begin\n if (areset) begin\n q <= 4'b0000;\n end else if (load) begin\n q <= data;\n end else if (ena) begin\n q <= {1'b0, q[3:1]};\n end\nend\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput areset,\n\tinput load,\n\tinput ena,\n\tinput [3:0] data,\n\toutput reg [3:0] q\n);\n\nalways @(posedge clk or posedge areset) begin\n\tif (areset) begin\n\t\tq <= 4'b0000;\n\tend else if (load) begin\n\t\tq <= data;\n\tend else if (ena) begin\n\t\tq <= {1'b0, q[3:1]};\n\tend\nend\n\nendmodule\n", "module top_module(\n input clk,\n input areset,\n input load,\n input ena,\n input [3:0] data,\n output reg [3:0] q\n);\n\nalways @(posedge clk or posedge areset) begin\n if (areset) begin\n q <= 4'b0000;\n end else if (load) begin\n q <= data;\n end else if (ena) begin\n q <= {1'b0, q[3:1]};\n end\nend\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput areset,\n\tinput load,\n\tinput ena,\n\tinput [3:0] data,\n\toutput reg [3:0] q);\n\n\talways @(posedge clk or posedge areset) begin\n\t\tif (areset) begin\n\t\t\tq <= 4'b0000;\n\t\tend else if (load) begin\n\t\t\tq <= data;\n\t\tend else if (ena) begin\n\t\t\tq <= {1'b0, q[3:1]};\n\t\tend\n\tend\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput areset,\n\tinput load,\n\tinput ena,\n\tinput [3:0] data,\n\toutput reg [3:0] q\n);\n\talways @(posedge clk or posedge areset) begin\n\t\tif (areset) begin\n\t\t\tq <= 4'b0000;\n\t\tend else if (load) begin\n\t\t\tq <= data;\n\t\tend else if (ena) begin\n\t\t\tq <= {1'b0, q[3:1]};\n\t\tend\n\tend\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput areset,\n\tinput load,\n\tinput ena,\n\tinput [3:0] data,\n\toutput reg [3:0] q);\n\t\n\talways @(posedge clk or posedge areset) begin\n\t\tif (areset) begin\n\t\t\tq <= 4'b0000;\n\t\tend else if (load) begin\n\t\t\tq <= data;\n\t\tend else if (ena) begin\n\t\t\tq <= {1
{"task_id": "truthtable1", "llmgen_RTL": ["module top_module (\n input x3,\n input x2,\n input x1,\n output f\n);\n assign f = (x2 & ~x1) | (x2 & x1) | (x3 & x1);\nendmodule\n", "module top_module (\n input x3,\n input x2,\n input x1,\n output f\n);\n assign f = ( ~x3 & x2 & ~x1 ) | ( ~x3 & x2 & x1 ) | ( x3 & ~x2 & x1 ) | ( x3 & x2 & x1 );\nendmodule\n", "module top_module (\n input x3,\n input x2,\n input x1,\n output f\n);\n assign f = (x2 & ~x1) | (x2 & x1) | (x3 & x1) | (x3 & ~x2);\nendmodule\n", "module top_module (\n\tinput x3,\n\tinput x2,\n\tinput x1,\n\toutput f\n);\n\tassign f = (~x3 & x2 & x1) | (~x3 & x2 & ~x1) | (x3 & ~x2 & x1);\nendmodule\n", "module top_module (\n input x3,\n input x2,\n input x1,\n output f\n);\n assign f = (x2 & ~x1) | (x2 & x1) | (x3 & x1);\nendmodule\n", "module top_module (\n input x3,\n input x2,\n input x1,\n output f\n);\n assign f = (~x3 & x2 & x1) | (~x3 & x2 & ~x1) | (x3 & ~x2 & x1) | (x3 & x2 & x1);\nendmodule\n", "module top_module (\n\tinput x3,\n\tinput x2,\n\tinput x1,\n\toutput f\n);\n\tassign f = (~x3 & x2 & ~x1) | (~x3 & x2 & x1) | (x3 & x2 & x1);\nendmodule\n", "module top_module (\n input x3,\n input x2,\n input x1,\n output f\n);\n assign f = ( ~x3 & x2 & ~x1 ) | ( ~x3 & x2 & x1 ) | ( x3 & x2 & x1 ) | ( x3 & ~x2 & x1 );\nendmodule\n", "module top_module (\n\tinput x3,\n\tinput x2,\n\tinput x1,\n\toutput f\n);\n\nassign f = (x2 & ~x1) | (x2 & x1) | (x3 & x1);\n\nendmodule\n", "module top_module (\n\tinput x3,\n\tinput x2,\n\tinput x1,\n\toutput f\n);\n\tassign f = ( ~x3 & x2 & ~x1 ) | ( ~x3 & x2 & x1 ) | ( x3 & ~x2 & x1 ) | ( x3 & x2 & x1 );\nendmodule\n", "module top_module (\n\tinput x3,\n\tinput x2,\n\tinput x1,\n\toutput f\n);\n\nassign f = (x2 & ~x1) | (x2 & x1) | (x3 & x1);\n\nendmodule\n", "module top_module (\n\tinput x3,\n\tinput x2,\n\tinput x1,\n\toutput f\n);\n\tassign f = (x2 & ~x1) | (x2 & x1) | (x3 & x1);\nendmodule\n", "module top_module (\n\tinput x3,\n\tinput x2,\n\tinput x1,\n\toutput f\n);\n\tassign f = (x2 & ~x1) | (x2 & x1) | (x3 & x1);\nendmodule\n", "module top_module (\n input x3,\n input x2,\n input x1,\n output f\n);\n\nassign f = (~x3 & x2 & ~x1) | (~x3 & x2 & x1) | (x3 & ~x2 & x1) | (x3 & x2 & x1);\n\nendmodule\n", "module top_module (\n\tinput x3,\n\tinput x2,\n\tinput x1,\n\toutput f\n);\n\tassign f = (~x3 & x2 & ~x1) | (~x3 & x2 & x1) | (x3 & x2 & x1) | (x3 & ~x2 & x1);\nendmodule\n", "module top_module (\n\tinput x3,\n\tinput x2,\n\tinput x1,\n\toutput f\n);\n\tassign f = (x2 & ~x1) | (x2 & x1) | (x3 & x1);\nendmodule\n", "module top_module (\n\tinput x3,\n\tinput x2,\n\tinput x1,\n\toutput f\n);\n\tassign f = (~x3 & x2 & x1) | (~x3 & x2 & ~x1) | (x3 & ~x2 & x1) | (x3 & x2 & x1);\nendmodule\n", "module top_module (\n input x3,\n input x2,\n input x1,\n output f\n);\n assign f = ( ~x3 & x2 & ~x1 ) | ( ~x3 & x2 & x1 ) | ( x3 & x2 & x1 ) | ( x3 & ~x2 & x1 );\nendmodule\n", "module top_module (\n\tinput x3,\n\tinput x2,\n\tinput x1,\n\toutput f\n);\n\tassign f = (x2 & ~x1) | (x2 & x1) | (x3 & x1);\nendmodule\n", "module top_module (\n input x3,\n input x2,\n input x1,\n output f\n);\n assign f = (x2 & ~x1) | (x2 & x1) | (x3 & x1);\nendmodule\n"]}
{"task_id": "dff8ar", "llmgen_RTL": ["module top_module(\n input clk,\n input [7:0] d,\n input areset,\n output reg [7:0] q\n);\n\n always @(posedge clk or posedge areset) begin\n if (areset) begin\n q <= 8'b0;\n end else begin\n q <= d;\n end\n end\n\nendmodule\n", "module top_module(\n input clk,\n input [7:0] d,\n input areset,\n output reg [7:0] q\n);\n always @(posedge clk or posedge areset) begin\n if (areset) begin\n q <= 8'b0;\n end else begin\n q <= d;\n end\n end\nendmodule\n", "module top_module(\n input clk,\n input [7:0] d,\n input areset,\n output reg [7:0] q\n);\n\n always @(posedge clk or posedge areset) begin\n if (areset) begin\n q <= 8'b0;\n end else begin\n q <= d;\n end\n end\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput [7:0] d,\n\tinput areset,\n\toutput reg [7:0] q);\n\n\talways @(posedge clk or posedge areset) begin\n\t\tif (areset) begin\n\t\t\tq <= 8'b0;\n\t\tend else begin\n\t\t\tq <= d;\n\t\tend\n\tend\n\nendmodule\n", "module top_module(\n input clk,\n input [7:0] d,\n input areset,\n output reg [7:0] q\n);\n\nalways @(posedge clk or posedge areset) begin\n if (areset) begin\n q <= 8'b0;\n end else begin\n q <= d;\n end\nend\n\nendmodule\n", "module top_module(\n input clk,\n input [7:0] d,\n input areset,\n output reg [7:0] q\n);\n always @(posedge clk or posedge areset) begin\n if (areset) begin\n q <= 8'b0;\n end else begin\n q <= d;\n end\n end\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput [7:0] d,\n\tinput areset,\n\toutput reg [7:0] q);\n\n\talways @(posedge clk or posedge areset) begin\n\t\tif (areset) \n\t\t\tq <= 8'b00000000;\n\t\telse \n\t\t\tq <= d;\n\tend\n\nendmodule\n", "module top_module(\n input clk,\n input [7:0] d,\n input areset,\n output reg [7:0] q\n);\n\nalways @(posedge clk or posedge areset) begin\n if (areset)\n q <= 8'b0;\n else\n q <= d;\nend\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput [7:0] d,\n\tinput areset,\n\toutput reg [7:0] q);\n\n\talways @(posedge clk or posedge areset) begin\n\t\tif (areset) begin\n\t\t\tq <= 8'b0;\n\t\tend else begin\n\t\t\tq <= d;\n\t\tend\n\tend\nendmodule\n", "module top_module(\n input clk,\n input [7:0] d,\n input areset,\n output reg [7:0] q\n);\n always @(posedge clk or posedge areset) begin\n if (areset) begin\n q <= 8'b0;\n end else begin\n q <= d;\n end\n end\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput [7:0] d,\n\tinput areset,\n\toutput reg [7:0] q);\n\n\talways @(posedge clk or posedge areset) begin\n\t\tif (areset) begin\n\t\t\tq <= 8'b0;\n\t\tend else begin\n\t\t\tq <= d;\n\t\tend\n\tend\n\nendmodule\n", "module top_module(\n input clk,\n input [7:0] d,\n input areset,\n output reg [7:0] q\n);\n\nalways @(posedge clk or posedge areset) begin\n if (areset) \n q <= 8'b0;\n else \n q <= d;\nend\n\nendmodule\n", "module top_module(\n input clk,\n input [7:0] d,\n input areset,\n output reg [7:0] q\n);\n\n always @(posedge clk or posedge areset) begin\n if (areset) begin\n q <= 8'b0;\n end else begin\n q <= d;\n end\n end\n\nendmodule\n", "module top_module(\n input clk,\n input [7:0] d,\n input areset,\n output reg [7:0] q);\n \n always @(posedge clk or posedge areset) begin\n if (areset) begin\n q <= 8'b0;\n end else begin\n q <= d;\n end\n end\n\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput [7:0] d,\n\tinput areset,\n\toutput reg [7:0] q\n);\n\n\talways @(posedge clk or posedge areset) begin\n\t\tif (areset) \n\t\t\tq <= 8'b0;\n\t\telse \n\t\t\tq <= d;\n\tend\n\nendmodule\n", "module top_module(\n input clk,\n input [7:0] d,\n inp
{"task_id": "gates100", "llmgen_RTL": ["module top_module (\n\tinput [99:0] in,\n\toutput out_and,\n\toutput out_or,\n\toutput out_xor\n);\n\n\tassign out_and = &in;\n\tassign out_or = |in;\n\tassign out_xor = ^in;\n\nendmodule\n", "module top_module (\n\tinput [99:0] in,\n\toutput out_and,\n\toutput out_or,\n\toutput out_xor\n);\n\nassign out_and = &in;\nassign out_or = |in;\nassign out_xor = ^in;\n\nendmodule\n", "module top_module (\n input [99:0] in,\n output out_and,\n output out_or,\n output out_xor\n);\n\nassign out_and = &in;\nassign out_or = |in;\nassign out_xor = ^in;\n\nendmodule\n", "module top_module (\n input [99:0] in,\n output out_and,\n output out_or,\n output out_xor\n);\n assign out_and = &in; // 100-input AND gate\n assign out_or = |in; // 100-input OR gate\n \n // 100-input XOR gate\n integer i;\n always @(*) begin\n out_xor = 0;\n for(i = 0; i < 100; i = i + 1) begin\n out_xor = out_xor ^ in[i];\n end\n end\nendmodule\n", "module top_module (\n input [99:0] in,\n output out_and,\n output out_or,\n output out_xor\n);\n\nassign out_and = &in; // 100-input AND\nassign out_or = |in; // 100-input OR\nassign out_xor = ^in; // 100-input XOR\n\nendmodule\n", "module top_module (\n input [99:0] in,\n output out_and,\n output out_or,\n output out_xor\n);\n\nassign out_and = &in; // AND reduction\nassign out_or = |in; // OR reduction\n\nassign out_xor = ^in; // XOR reduction\n\nendmodule\n", "module top_module (\n input [99:0] in,\n output out_and,\n output out_or,\n output out_xor\n);\n\nassign out_and = &in; // 100-input AND\nassign out_or = |in; // 100-input OR\nassign out_xor = ^in; // 100-input XOR\n\nendmodule\n", "module top_module (\n input [99:0] in,\n output out_and,\n output out_or,\n output out_xor\n);\n assign out_and = &in;\n assign out_or = |in;\n assign out_xor = ^in;\nendmodule\n", "module top_module (\n\tinput [99:0] in,\n\toutput out_and,\n\toutput out_or,\n\toutput out_xor\n);\n\nassign out_and = &in; // 100-input AND gate\nassign out_or = |in; // 100-input OR gate\nassign out_xor = ^in; // 100-input XOR gate\n\nendmodule\n", "module top_module (\n input [99:0] in,\n output out_and,\n output out_or,\n output out_xor\n);\n\nassign out_and = &in; // 100-input AND gate\nassign out_or = |in; // 100-input OR gate\nassign out_xor = ^in; // 100-input XOR gate\n\nendmodule\n", "module top_module (\n input [99:0] in,\n output out_and,\n output out_or,\n output out_xor\n);\n\nassign out_and = &in;\nassign out_or = |in;\nassign out_xor = ^in;\n\nendmodule\n", "module top_module (\n\tinput [99:0] in,\n\toutput out_and,\n\toutput out_or,\n\toutput out_xor\n);\n\nassign out_and = &in;\nassign out_or = |in;\nassign out_xor = ^in;\n\nendmodule\n", "module top_module (\n\tinput [99:0] in,\n\toutput out_and,\n\toutput out_or,\n\toutput out_xor\n);\n\tassign out_and = &in; // AND operation\n\tassign out_or = |in; // OR operation\n\tassign out_xor = ^in; // XOR operation\nendmodule\n", "module top_module (\n input [99:0] in,\n output out_and,\n output out_or,\n output out_xor\n);\n\nassign out_and = &in; // 100-input AND\nassign out_or = |in; // 100-input OR\nassign out_xor = ^in; // 100-input XOR\n\nendmodule\n", "module top_module (\n input [99:0] in,\n output out_and,\n output out_or,\n output out_xor\n);\n\nassign out_and = &in;\nassign out_or = |in;\nassign out_xor = ^in;\n\nendmodule\n", "module top_module (\n\tinput [99:0] in,\n\toutput out_and,\n\toutput out_or,\n\toutput out_xor\n);\n\nassign out_and = &in;\nassign out_or = |in;\nassign out_xor = ^in;\n\nendmodule\n", "module top_module (\n\tinput [99:0] in,\n\toutput out_and,\n\toutput out_or,\n\toutput out_xor\n);\n\nassign out_and = &in; // 100-input AND\nassign out_or = |in; // 100-input OR\n\nwire [99:0] xor_temp;\ngenvar i;\n\ngenerate\n\tfor (i = 0; i < 99; i = i + 1
{"task_id": "hadd", "llmgen_RTL": ["module top_module (\n\tinput a,\n\tinput b,\n\toutput sum,\n\toutput cout\n);\n\tassign sum = a ^ b;\n\tassign cout = a & b;\nendmodule\n", "module top_module (\n\tinput a,\n\tinput b,\n\toutput sum,\n\toutput cout\n);\n\nassign sum = a ^ b; // Sum is the XOR of the two inputs\nassign cout = a & b; // Carry out is the AND of the two inputs\n\nendmodule\n", "module top_module (\n\tinput a,\n\tinput b,\n\toutput sum,\n\toutput cout\n);\n\tassign sum = a ^ b;\n\tassign cout = a & b;\nendmodule\n", "module top_module (\n\tinput a,\n\tinput b,\n\toutput sum,\n\toutput cout\n);\n\n\tassign sum = a ^ b;\n\tassign cout = a & b;\n\nendmodule\n", "module top_module (\n\tinput a,\n\tinput b,\n\toutput sum,\n\toutput cout\n);\n\tassign sum = a ^ b;\n\tassign cout = a & b;\nendmodule\n", "module top_module (\n input a,\n input b,\n output sum,\n output cout\n);\n assign sum = a ^ b; // Sum is the XOR of a and b\n assign cout = a & b; // Carry-out is the AND of a and b\nendmodule\n", "module top_module (\n\tinput a,\n\tinput b,\n\toutput sum,\n\toutput cout\n);\n\n\tassign sum = a ^ b;\n\tassign cout = a & b;\n\nendmodule\n", "module top_module (\n\tinput a,\n\tinput b,\n\toutput sum,\n\toutput cout\n);\n\n\tassign sum = a ^ b;\n\tassign cout = a & b;\n\nendmodule\n", "module top_module (\n\tinput a,\n\tinput b,\n\toutput sum,\n\toutput cout\n);\n\nassign sum = a ^ b;\nassign cout = a & b;\n\nendmodule\n", "module top_module (\n input a,\n input b,\n output sum,\n output cout\n);\n assign sum = a ^ b;\n assign cout = a & b;\nendmodule\n", "module top_module (\n\tinput a,\n\tinput b,\n\toutput sum,\n\toutput cout\n);\n\nassign sum = a ^ b;\nassign cout = a & b;\n\nendmodule\n", "module top_module (\n\tinput a,\n\tinput b,\n\toutput sum,\n\toutput cout\n);\n\n\tassign sum = a ^ b; // Sum is the XOR of inputs a and b\n\tassign cout = a & b; // Carry-out is the AND of inputs a and b\n\nendmodule\n", "module top_module (\n\tinput a,\n\tinput b,\n\toutput sum,\n\toutput cout\n);\n\nassign sum = a ^ b;\nassign cout = a & b;\n\nendmodule\n", "module top_module (\n\tinput a,\n\tinput b,\n\toutput sum,\n\toutput cout\n);\n\n\tassign sum = a ^ b; // Sum is the XOR of inputs a and b\n\tassign cout = a & b; // Carry-out is the AND of inputs a and b\n\nendmodule\n", "module top_module (\n\tinput a,\n\tinput b,\n\toutput sum,\n\toutput cout\n);\n\tassign sum = a ^ b;\n\tassign cout = a & b;\nendmodule\n", "module top_module (\n input a,\n input b,\n output sum,\n output cout\n);\n assign sum = a ^ b; // Sum is the XOR of inputs a and b\n assign cout = a & b; // Carry-out is the AND of inputs a and b\nendmodule\n", "module top_module (\n\tinput a,\n\tinput b,\n\toutput sum,\n\toutput cout\n);\n\n\tassign sum = a ^ b; // Sum is the XOR of inputs\n\tassign cout = a & b; // Carry-out is the AND of inputs\n\nendmodule\n", "module top_module (\n\tinput a,\n\tinput b,\n\toutput sum,\n\toutput cout\n);\n\nassign sum = a ^ b;\nassign cout = a & b;\n\nendmodule\n", "module top_module (\n\tinput a,\n\tinput b,\n\toutput sum,\n\toutput cout\n);\n\tassign sum = a ^ b;\n\tassign cout = a & b;\nendmodule\n", "module top_module (\n\tinput a,\n\tinput b,\n\toutput sum,\n\toutput cout\n);\n assign sum = a ^ b;\n assign cout = a & b;\nendmodule\n"]}
{"task_id": "always_if2", "llmgen_RTL": ["module top_module (\n input cpu_overheated,\n output reg shut_off_computer,\n input arrived,\n input gas_tank_empty,\n output reg keep_driving\n);\n\n always @(*) begin\n if (cpu_overheated)\n shut_off_computer = 1;\n else\n shut_off_computer = 0; // Add else to reset the output\n end\n\n always @(*) begin\n if (~arrived)\n keep_driving = ~gas_tank_empty;\n else\n keep_driving = 0; // Add else to reset the output when arrived\n end\n\nendmodule\n", "module top_module (\n\tinput cpu_overheated,\n\toutput reg shut_off_computer,\n\tinput arrived,\n\tinput gas_tank_empty,\n\toutput reg keep_driving\n);\n\n\talways @(*) begin\n\t\tif (cpu_overheated)\n\t\t\tshut_off_computer = 1;\n\t\telse\n\t\t\tshut_off_computer = 0; // Reset if not overheated\n\tend\n\n\talways @(*) begin\n\t\tif (~arrived)\n\t\t\tkeep_driving = ~gas_tank_empty;\n\t\telse\n\t\t\tkeep_driving = 0; // Stop driving if arrived\n\tend\n\nendmodule\n", "module top_module (\n\tinput cpu_overheated,\n\toutput reg shut_off_computer,\n\tinput arrived,\n\tinput gas_tank_empty,\n\toutput reg keep_driving\n);\n\n\talways @(*) begin\n\t\tif (cpu_overheated)\n\t\t\tshut_off_computer = 1;\n\t\telse\n\t\t\tshut_off_computer = 0; // Reset if not overheated\n\tend\n\n\talways @(*) begin\n\t\tif (~arrived)\n\t\t\tkeep_driving = ~gas_tank_empty;\n\t\telse\n\t\t\tkeep_driving = 0; // Stop driving if arrived\n\tend\n\nendmodule\n", "module top_module (\n\tinput cpu_overheated,\n\toutput reg shut_off_computer,\n\tinput arrived,\n\tinput gas_tank_empty,\n\toutput reg keep_driving\n);\n\n\talways @(*) begin\n\t\tif (cpu_overheated)\n\t\t\tshut_off_computer = 1;\n\t\telse\n\t\t\tshut_off_computer = 0; // Reset value when not overheated\n\tend\n\n\talways @(*) begin\n\t\tif (~arrived)\n\t\t\tkeep_driving = ~gas_tank_empty;\n\t\telse\n\t\t\tkeep_driving = 0; // Reset value when arrived\n\tend\n\nendmodule\n", "module top_module (\n\tinput cpu_overheated,\n\toutput reg shut_off_computer,\n\tinput arrived,\n\tinput gas_tank_empty,\n\toutput reg keep_driving\n);\n\n\talways @(*) begin\n\t\tif (cpu_overheated)\n\t\t\tshut_off_computer = 1;\n\t\telse\n\t\t\tshut_off_computer = 0; // Reset the output when not overheated\n\tend\n\n\talways @(*) begin\n\t\tif (~arrived)\n\t\t\tkeep_driving = ~gas_tank_empty;\n\t\telse\n\t\t\tkeep_driving = 0; // Stop driving when arrived\n\tend\n\nendmodule\n", "module top_module (\n\tinput cpu_overheated,\n\toutput reg shut_off_computer,\n\tinput arrived,\n\tinput gas_tank_empty,\n\toutput reg keep_driving\n);\n\n\talways @(*) begin\n\t\tif (cpu_overheated)\n\t\t\tshut_off_computer = 1;\n\t\telse\n\t\t\tshut_off_computer = 0; // Set to 0 when not overheated\n\tend\n\n\talways @(*) begin\n\t\tif (~arrived)\n\t\t\tkeep_driving = ~gas_tank_empty;\n\t\telse\n\t\t\tkeep_driving = 0; // Set to 0 when arrived\n\tend\n\nendmodule\n", "module top_module (\n\tinput cpu_overheated,\n\toutput reg shut_off_computer,\n\tinput arrived,\n\tinput gas_tank_empty,\n\toutput reg keep_driving\n);\n\n\talways @(*) begin\n\t\tif (cpu_overheated)\n\t\t\tshut_off_computer = 1;\n\t\telse\n\t\t\tshut_off_computer = 0; // Added to reset shut_off_computer when not overheating\n\tend\n\n\talways @(*) begin\n\t\tif (~arrived)\n\t\t\tkeep_driving = ~gas_tank_empty;\n\t\telse\n\t\t\tkeep_driving = 0; // Added to reset keep_driving when arrived\n\tend\n\nendmodule\n", "module top_module (\n\tinput cpu_overheated,\n\toutput reg shut_off_computer,\n\tinput arrived,\n\tinput gas_tank_empty,\n\toutput reg keep_driving\n);\n\n always @(*) begin\n if (cpu_overheated)\n shut_off_computer = 1;\n else\n shut_off_computer = 0; // Added to reset the output when not overheated\n end\n\n always @(*) begin\n if (~arrived)\n keep_driving = ~gas_tank_empty;\n else\n keep_driving = 0; // Added to reset the output when arrived\n end\n\nendmodule\n", "module top_module (\n\tinput cpu_over
{"task_id": "fsm2s", "llmgen_RTL": ["module top_module (\n\tinput clk,\n\tinput j,\n\tinput k,\n\tinput reset,\n\toutput reg out\n);\n\n\ttypedef enum reg [1:0] {OFF, ON} state_t;\n\tstate_t state, next_state;\n\n\talways @(posedge clk or posedge reset) begin\n\t\tif (reset) begin\n\t\t\tstate <= OFF;\n\t\tend else begin\n\t\t\tstate <= next_state;\n\t\tend\n\tend\n\n\talways @(*) begin\n\t\tcase (state)\n\t\t\tOFF: begin\n\t\t\t\tout = 0;\n\t\t\t\tif (j) next_state = ON;\n\t\t\t\telse next_state = OFF;\n\t\t\tend\n\t\t\tON: begin\n\t\t\t\tout = 1;\n\t\t\t\tif (k) next_state = OFF;\n\t\t\t\telse next_state = ON;\n\t\t\tend\n\t\tendcase\n\tend\n\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput j,\n\tinput k,\n\tinput reset,\n\toutput reg out\n);\n\n\ttypedef enum reg [1:0] {OFF, ON} state_t;\n\tstate_t current_state, next_state;\n\n\t// State transition logic\n\talways @(*) begin\n\t\tcase (current_state)\n\t\t\tOFF: begin\n\t\t\t\tif (j == 1) begin\n\t\t\t\t\tnext_state = ON;\n\t\t\t\tend else begin\n\t\t\t\t\tnext_state = OFF;\n\t\t\t\tend\n\t\t\tend\n\t\t\tON: begin\n\t\t\t\tif (k == 1) begin\n\t\t\t\t\tnext_state = OFF;\n\t\t\t\tend else begin\n\t\t\t\t\tnext_state = ON;\n\t\t\t\tend\n\t\t\tend\n\t\tendcase\n\tend\n\n\t// Output logic\n\talways @(*) begin\n\t\tcase (current_state)\n\t\t\tOFF: out = 0;\n\t\t\tON: out = 1;\n\t\tendcase\n\tend\n\n\t// State register\n\talways @(posedge clk) begin\n\t\tif (reset) begin\n\t\t\tcurrent_state <= OFF;\n\t\tend else begin\n\t\t\tcurrent_state <= next_state;\n\t\tend\n\tend\n\nendmodule\n", "module top_module (\n input clk,\n input j,\n input k,\n input reset,\n output reg out\n);\n\n typedef enum logic [1:0] {OFF, ON} state_t;\n state_t current_state, next_state;\n\n always_ff @(posedge clk) begin\n if (reset) begin\n current_state <= OFF;\n end else begin\n current_state <= next_state;\n end\n end\n\n always_comb begin\n case (current_state)\n OFF: begin\n out = 0;\n if (j == 1) begin\n next_state = ON;\n end else begin\n next_state = OFF;\n end\n end\n ON: begin\n out = 1;\n if (k == 1) begin\n next_state = OFF;\n end else begin\n next_state = ON;\n end\n end\n default: begin\n next_state = OFF;\n end\n endcase\n end\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput j,\n\tinput k,\n\tinput reset,\n\toutput reg out\n);\n\n\ttypedef enum reg [1:0] {\n\t\tOFF = 2'b00,\n\t\tON = 2'b01\n\t} state_t;\n\n\tstate_t current_state, next_state;\n\n\t// State transition\n\talways @(posedge clk or posedge reset) begin\n\t\tif (reset) begin\n\t\t\tcurrent_state <= OFF;\n\t\tend else begin\n\t\t\tcurrent_state <= next_state;\n\t\tend\n\tend\n\n\t// Next state logic\n\talways @(*) begin\n\t\tcase (current_state)\n\t\t\tOFF: begin\n\t\t\t\tif (j) \n\t\t\t\t\tnext_state = ON;\n\t\t\t\telse \n\t\t\t\t\tnext_state = OFF;\n\t\t\tend\n\t\t\tON: begin\n\t\t\t\tif (k) \n\t\t\t\t\tnext_state = OFF;\n\t\t\t\telse \n\t\t\t\t\tnext_state = ON;\n\t\t\tend\n\t\t\tdefault: next_state = OFF; // Default case to avoid latch\n\t\tendcase\n\tend\n\n\t// Output logic\n\talways @(*) begin\n\t\tcase (current_state)\n\t\t\tOFF: out = 0;\n\t\t\tON: out = 1;\n\t\t\tdefault: out = 0; // Default case\n\t\tendcase\n\tend\n\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput j,\n\tinput k,\n\tinput reset,\n\toutput reg out\n);\n\n\treg state; // 0 for OFF, 1 for ON\n\n\talways @(posedge clk) begin\n\t\tif (reset) begin\n\t\t\tstate <= 0; // Reset to OFF\n\t\t\tout <= 0;\n\t\tend else begin\n\t\t\tcase (state)\n\t\t\t\t0: begin // OFF state\n\t\t\t\t\tif (j == 1) begin\n\t\t\t\t\t\tstate <= 1; // Transition to ON\n\t\t\t\t\tend\n\t\t\t\t\tout <= 0; // Output is 0 in OFF\n\t\t\t\tend\n\t\t\t\t1: begin // ON state\n\t\t\t\t\tif (k == 1
{"task_id": "vector3", "llmgen_RTL": ["module top_module (\n\tinput [4:0] a,\n\tinput [4:0] b,\n\tinput [4:0] c,\n\tinput [4:0] d,\n\tinput [4:0] e,\n\tinput [4:0] f,\n\toutput [7:0] w,\n\toutput [7:0] x,\n\toutput [7:0] y,\n\toutput [7:0] z\n);\n\n\twire [29:0] concatenated;\n\tassign concatenated = {a, b, c, d, e, f}; \n\n\tassign w = {concatenated[29:22], 2'b11}; // 8 bits from the upper part and two 1 bits\n\tassign x = {concatenated[21:14], 2'b11}; // 8 bits from the middle part and two 1 bits\n\tassign y = {concatenated[13:6], 2'b11}; // 8 bits from the lower part and two 1 bits\n\tassign z = {concatenated[5:0], 2'b11}; // Remaining bits and two 1 bits\n\nendmodule\n", "module top_module (\n input [4:0] a,\n input [4:0] b,\n input [4:0] c,\n input [4:0] d,\n input [4:0] e,\n input [4:0] f,\n output [7:0] w,\n output [7:0] x,\n output [7:0] y,\n output [7:0] z\n);\n\n wire [29:0] concatenated_inputs;\n assign concatenated_inputs = {a, b, c, d, e, f};\n\n assign w = {concatenated_inputs[29:24], 2'b01}; // 8 bits from the highest input bits + 2 LSB\n assign x = {concatenated_inputs[23:16], 2'b01}; // next 8 bits + 2 LSB\n assign y = {concatenated_inputs[15:8], 2'b01}; // next 8 bits + 2 LSB\n assign z = {concatenated_inputs[7:0], 2'b01}; // last 8 bits + 2 LSB\n\nendmodule\n", "module top_module (\n input [4:0] a,\n input [4:0] b,\n input [4:0] c,\n input [4:0] d,\n input [4:0] e,\n input [4:0] f,\n output [7:0] w,\n output [7:0] x,\n output [7:0] y,\n output [7:0] z\n);\n\n wire [29:0] concatenated_inputs;\n assign concatenated_inputs = {a, b, c, d, e, f};\n\n assign w = {concatenated_inputs[29:24], 2'b01};\n assign x = {concatenated_inputs[23:16], 2'b01};\n assign y = {concatenated_inputs[15:8], 2'b01};\n assign z = {concatenated_inputs[7:0], 2'b01};\n\nendmodule\n", "module top_module (\n input [4:0] a,\n input [4:0] b,\n input [4:0] c,\n input [4:0] d,\n input [4:0] e,\n input [4:0] f,\n output [7:0] w,\n output [7:0] x,\n output [7:0] y,\n output [7:0] z\n);\n\n wire [29:0] concatenated;\n assign concatenated = {a, b, c, d, e, f};\n\n assign w = {concatenated[29:22], 2'b01};\n assign x = {concatenated[21:14], 2'b01};\n assign y = {concatenated[13:6], 2'b01};\n assign z = {concatenated[5:0], 2'b01};\n\nendmodule\n", "module top_module (\n input [4:0] a,\n input [4:0] b,\n input [4:0] c,\n input [4:0] d,\n input [4:0] e,\n input [4:0] f,\n output [7:0] w,\n output [7:0] x,\n output [7:0] y,\n output [7:0] z\n);\n wire [29:0] concat_inputs;\n assign concat_inputs = {a, b, c, d, e, f};\n\n assign w = concat_inputs[29:22];\n assign x = concat_inputs[21:14];\n assign y = concat_inputs[13:6];\n assign z = {concat_inputs[5:0], 2'b11};\n\nendmodule\n", "module top_module (\n\tinput [4:0] a,\n\tinput [4:0] b,\n\tinput [4:0] c,\n\tinput [4:0] d,\n\tinput [4:0] e,\n\tinput [4:0] f,\n\toutput [7:0] w,\n\toutput [7:0] x,\n\toutput [7:0] y,\n\toutput [7:0] z\n);\n\n\twire [29:0] concatenated_inputs; // 30 bits for concatenation\n\tassign concatenated_inputs = {a, b, c, d, e, f}; // Concatenate inputs\n\n\twire [31:0] full_output; // 32 bits for final output including 2 bits\n\tassign full_output = {concatenated_inputs, 2'b11}; // Append two 1 bits\n\n\tassign w = full_output[7:0]; // First 8 bits\n\tassign x = full_output[15:8]; // Second 8 bits\n\tassign y = full_output[23:16]; // Third 8 bits\n\tassign z = full_output[31:24]; // Fourth 8 bits\n\nendmodule\n", "module top_module (\n\tinput [4:0] a,\n\tinput [4:0] b,\n\tinput [4:0] c,\n\tinput [4:0] d,\n\tinput [4:0] e,\n\tinput [4:0] f,\n\toutput [7:0] w,\n\toutput [7:0] x,\n\toutput [7:0] y,\n\toutput [7:0] z\n);\n\n\twire [29:0] concatenated_inputs;\n\tassign concatenated_inputs = {a, b, c, d, e, f};\n\n\tassign w = {concatenated_inputs[29:22], 2'b01};\n\tassign x = {concatenated_inputs[21:14], 2'b01};\n\tassign y = {concatenated_inputs[13:6], 2'b01};\n\tassign z = {concatenat
{"task_id": "circuit2", "llmgen_RTL": ["module top_module (\n input a, \n input b, \n input c, \n input d,\n output q\n);\n assign q = (~a & ~b & ~c & ~d) | (~a & c & d) | (a & ~b & c) | (a & b & ~d) | (a & b & c & ~d);\nendmodule\n", "module top_module (\n\tinput a, \n\tinput b, \n\tinput c, \n\tinput d,\n\toutput q\n);\n\nassign q = (~a & ~b & ~c & ~d) | (~a & ~b & d) | (~a & c & b) | (a & ~b & c & ~d) | (a & b & ~c & d) | (a & b & c & d);\n\nendmodule\n", "module top_module (\n\tinput a, \n\tinput b, \n\tinput c, \n\tinput d,\n\toutput q\n);\n\tassign q = (~a & ~b & ~c & ~d) | (~a & ~b & c & d) | (~a & b & ~c & d) | (~a & b & c & ~d) | (a & b & ~c & ~d) | (a & b & c & d) | (a & ~b & c & d);\nendmodule\n", "module top_module (\n input a, \n input b, \n input c, \n input d,\n output q\n);\n assign q = (a == 0 && b == 0 && c == 0 && d == 0) || \n (a == 0 && b == 0 && c == 1 && d == 1) || \n (a == 0 && b == 1 && c == 0 && d == 1) || \n (a == 0 && b == 1 && c == 1 && d == 0) || \n (a == 1 && b == 0 && c == 0 && d == 1) || \n (a == 1 && b == 0 && c == 1 && d == 0) || \n (a == 1 && b == 1 && c == 0 && d == 0) || \n (a == 1 && b == 1 && c == 1 && d == 1);\nendmodule\n", "module top_module (\n input a, \n input b, \n input c, \n input d,\n output q\n);\n assign q = (~a & ~b & ~c & d) | (~a & b & ~c & ~d) | (~a & b & c & d) | (a & ~b & ~c & ~d) | (a & ~b & c & d) | (a & b & ~c & d);\nendmodule\n", "module top_module (\n input a, \n input b, \n input c, \n input d,\n output q\n);\n\nassign q = (~a & ~b & ~c & ~d) | (~a & ~b & c & d) | (~a & b & ~c & d) | (a & ~b & c & ~d) | (a & b & ~c & ~d) | (a & b & c & d);\n\nendmodule\n", "module top_module (\n\tinput a, \n\tinput b, \n\tinput c, \n\tinput d,\n\toutput q\n);\n\nassign q = (a == 0 && b == 0 && c == 0 && d == 0) || \n (a == 0 && b == 0 && c == 1 && d == 1) || \n (a == 0 && b == 1 && c == 0 && d == 1) || \n (a == 0 && b == 1 && c == 1 && d == 0) || \n (a == 1 && b == 0 && c == 0 && d == 1) || \n (a == 1 && b == 0 && c == 1 && d == 0) || \n (a == 1 && b == 1 && c == 1 && d == 1);\n\nendmodule\n", "module top_module (\n\tinput a, \n\tinput b, \n\tinput c, \n\tinput d,\n\toutput q\n);\n assign q = (~a & ~b & ~c & ~d) | (~a & ~b & d) | (~a & c & d) | (b & ~c & ~d) | (b & c & d) | (a & ~b & d) | (a & b & ~c);\nendmodule\n", "module top_module (\n input a, \n input b, \n input c, \n input d,\n output q\n);\n assign q = (~a & ~b & ~c & ~d) | \n (~a & ~b & d) | \n (~a & c & d) | \n (b & ~c & ~d) | \n (b & d) | \n (a & b & ~c) | \n (a & b & c & ~d) | \n (a & b & c & d);\nendmodule\n", "module top_module (\n input a, \n input b, \n input c, \n input d,\n output q\n);\n assign q = (~a & ~b & ~c & ~d) | \n (~a & ~b & d) | \n (~a & c & d) | \n (b & ~c & d) | \n (b & c & ~d) | \n (a & b & c & ~d) | \n (a & b & c & d);\nendmodule\n", "module top_module (\n input a, \n input b, \n input c, \n input d,\n output q\n);\n assign q = (a == 0 && b == 0 && c == 0 && d == 0) || \n (a == 0 && b == 0 && c == 1 && d == 1) || \n (a == 0 && b == 1 && c == 0 && d == 1) || \n (a == 0 && b == 1 && c == 1 && d == 0) || \n (a == 1 && b == 0 && c == 0 && d == 1) || \n (a == 1 && b == 0 && c == 1 && d == 0) || \n (a == 1 && b == 1 && c == 0 && d == 0) || \n (a == 1 && b == 1 && c == 1 && d == 1);\nendmodule\n", "module top_module (\n\tinput a, \n\tinput b, \n\tinput c, \n\tinput d,\n\toutput q\n);\n\nassign q = (~a & ~b & ~c & ~d) | (~a & ~b & c & d) | (~a & b & ~c & d) | (a & ~b & ~c & d) | (a & b & ~c & ~d) | (a & b & c & d);\n\nendmodule\n", "module top_m
{"task_id": "andgate", "llmgen_RTL": ["module top_module(\n\tinput a, \n\tinput b,\n\toutput out\n);\n\tassign out = a & b;\nendmodule\n", "module top_module(\n\tinput a, \n\tinput b,\n\toutput out\n);\n\tassign out = a & b;\nendmodule\n", "module top_module(\n\tinput a, \n\tinput b,\n\toutput out\n);\n\tassign out = a & b;\nendmodule\n", "module top_module(\n\tinput a, \n\tinput b,\n\toutput out\n);\n\tassign out = a & b;\nendmodule\n", "module top_module(\n\tinput a, \n\tinput b,\n\toutput out\n);\n\tassign out = a & b;\nendmodule\n", "module top_module(\n input a, \n input b,\n output out\n);\n assign out = a & b;\nendmodule\n", "module top_module(\n input a, \n input b,\n output out\n);\n assign out = a & b;\nendmodule\n", "module top_module(\n\tinput a, \n\tinput b,\n\toutput out\n);\n\tassign out = a & b;\nendmodule\n", "module top_module(\n\tinput a, \n\tinput b,\n\toutput out\n);\n\tassign out = a & b;\nendmodule\n", "module top_module(\n\tinput a, \n\tinput b,\n\toutput out\n);\n\tassign out = a & b;\nendmodule\n", "module top_module(\n\tinput a, \n\tinput b,\n\toutput out\n);\n\tassign out = a & b;\nendmodule\n", "module top_module(\n input a, \n input b,\n output out\n);\n assign out = a & b;\nendmodule\n", "module top_module(\n\tinput a, \n\tinput b,\n\toutput out\n);\n\tassign out = a & b;\nendmodule\n", "module top_module(\n\tinput a, \n\tinput b,\n\toutput out\n);\n\tassign out = a & b;\nendmodule\n", "module top_module(\n input a, \n input b,\n output out\n);\nassign out = a & b;\nendmodule\n", "module top_module(\n\tinput a, \n\tinput b,\n\toutput out\n);\n\tassign out = a & b;\nendmodule\n", "module top_module(\n\tinput a, \n\tinput b,\n\toutput out\n);\n\tassign out = a & b;\nendmodule\n", "module top_module(\n\tinput a, \n\tinput b,\n\toutput out\n);\n\tassign out = a & b;\nendmodule\n", "module top_module(\n\tinput a, \n\tinput b,\n\toutput out\n);\n\tassign out = a & b;\nendmodule\n", "module top_module(\n\tinput a, \n\tinput b,\n\toutput out\n);\n\tassign out = a & b;\nendmodule\n"]}
{"task_id": "fsm1s", "llmgen_RTL": ["module top_module (\n input clk,\n input in,\n input reset,\n output reg out\n);\n reg state;\n \n parameter B = 1'b1, A = 1'b0; // State Encoding: B = 1, A = 0\n\n always @(posedge clk) begin\n if (reset) begin\n state <= B; // Reset to state B\n out <= 1; // Output for state B\n end else begin\n case (state)\n B: begin\n if (in) begin\n state <= B; // Stay in B\n out <= 1; // Output for state B\n end else begin\n state <= A; // Transition to A\n out <= 0; // Output for state A\n end\n end\n A: begin\n if (in) begin\n state <= A; // Stay in A\n out <= 0; // Output for state A\n end else begin\n state <= B; // Transition to B\n out <= 1; // Output for state B\n end\n end\n endcase\n end\n end\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput in,\n\tinput reset,\n\toutput reg out\n);\n\n\ttypedef enum reg [1:0] {B, A} state_type;\n\tstate_type current_state, next_state;\n\n\talways @(posedge clk) begin\n\t\tif (reset) begin\n\t\t\tcurrent_state <= B;\n\t\tend else begin\n\t\t\tcurrent_state <= next_state;\n\t\tend\n\tend\n\t\n\talways @* begin\n\t\tcase (current_state)\n\t\t\tB: begin\n\t\t\t\tout = 1;\n\t\t\t\tif (in) next_state = B;\n\t\t\t\telse next_state = A;\n\t\t\tend\n\t\t\tA: begin\n\t\t\t\tout = 0;\n\t\t\t\tif (in) next_state = A;\n\t\t\t\telse next_state = B;\n\t\t\tend\n\t\tendcase\n\tend\n\nendmodule\n", "module top_module (\n input clk,\n input in,\n input reset,\n output reg out\n);\n\n typedef enum reg [1:0] {B, A} state_t;\n state_t state, next_state;\n\n always @(posedge clk) begin\n if (reset) begin\n state <= B;\n end else begin\n state <= next_state;\n end\n end\n\n always @* begin\n case (state)\n B: begin\n out = 1;\n if (in) begin\n next_state = B;\n end else begin\n next_state = A;\n end\n end\n A: begin\n out = 0;\n if (in) begin\n next_state = A;\n end else begin\n next_state = B;\n end\n end\n default: begin\n next_state = B; // Default case to handle any unexpected situation\n end\n endcase\n end\n\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput in,\n\tinput reset,\n\toutput reg out\n);\n\n\ttypedef enum reg [1:0] {B, A} state_t;\n\tstate_t state, next_state;\n\n\talways @ (posedge clk) begin\n\t\tif (reset) \n\t\t\tstate <= B;\n\t\telse \n\t\t\tstate <= next_state;\n\tend\n\n\talways @ (*) begin\n\t\tcase (state)\n\t\t\tB: begin\n\t\t\t\tout = 1;\n\t\t\t\tif (in) \n\t\t\t\t\tnext_state = B;\n\t\t\t\telse \n\t\t\t\t\tnext_state = A;\n\t\t\tend\n\t\t\tA: begin\n\t\t\t\tout = 0;\n\t\t\t\tif (in) \n\t\t\t\t\tnext_state = A;\n\t\t\t\telse \n\t\t\t\t\tnext_state = B;\n\t\t\tend\n\t\t\tdefault: begin\n\t\t\t\tout = 1; \n\t\t\t\tnext_state = B; \n\t\t\tend\n\t\tendcase\n\tend\nendmodule\n", "module top_module (\n input clk,\n input in,\n input reset,\n output reg out\n);\n \n reg state, next_state;\n \n parameter B = 1'b0, A = 1'b1;\n\n always @(posedge clk) begin\n if (reset) begin\n state <= B;\n end else begin\n state <= next_state;\n end\n end\n\n always @(*) begin\n case (state)\n B: begin\n out = 1;\n if (in)\n next_state = B;\n else\n next_state = A;\n
{"task_id": "fadd", "llmgen_RTL": ["module top_module (\n\tinput a,\n\tinput b,\n\tinput cin,\n\toutput cout,\n\toutput sum\n);\n\tassign sum = a ^ b ^ cin;\n\tassign cout = (a & b) | (cin & (a ^ b));\nendmodule\n", "module top_module (\n\tinput a,\n\tinput b,\n\tinput cin,\n\toutput cout,\n\toutput sum\n);\n\nassign sum = a ^ b ^ cin;\nassign cout = (a & b) | (cin & (a ^ b));\n\nendmodule\n", "module top_module (\n\tinput a,\n\tinput b,\n\tinput cin,\n\toutput cout,\n\toutput sum\n);\n\tassign sum = a ^ b ^ cin;\n\tassign cout = (a & b) | (cin & (a ^ b));\nendmodule\n", "module top_module (\n\tinput a,\n\tinput b,\n\tinput cin,\n\toutput cout,\n\toutput sum\n);\n\twire s1, c1, c2;\n\n\tassign sum = a ^ b ^ cin; // Sum calculation\n\tassign c1 = a & b; // First carry\n\tassign c2 = (a ^ b) & cin; // Second carry\n\tassign cout = c1 | c2; // Final carry out\nendmodule\n", "module top_module (\n input a,\n input b,\n input cin,\n output cout,\n output sum\n);\n assign sum = a ^ b ^ cin;\n assign cout = (a & b) | (cin & (a ^ b));\nendmodule\n", "module top_module (\n input a,\n input b,\n input cin,\n output cout,\n output sum\n);\n assign sum = a ^ b ^ cin;\n assign cout = (a & b) | (cin & (a ^ b));\nendmodule\n", "module top_module (\n input a,\n input b,\n input cin,\n output cout,\n output sum\n);\n assign sum = a ^ b ^ cin; // Sum is the XOR of a, b, and cin\n assign cout = (a & b) | (cin & (a ^ b)); // Carry-out is true if any two of the inputs are true\nendmodule\n", "module top_module (\n\tinput a,\n\tinput b,\n\tinput cin,\n\toutput cout,\n\toutput sum\n);\n\nassign sum = a ^ b ^ cin; // Sum is the XOR of a, b, and cin\nassign cout = (a & b) | (cin & (a ^ b)); // Carry-out is generated by the conditions\n\nendmodule\n", "module top_module (\n\tinput a,\n\tinput b,\n\tinput cin,\n\toutput cout,\n\toutput sum\n);\n\n assign sum = a ^ b ^ cin;\n assign cout = (a & b) | (b & cin) | (a & cin);\n\nendmodule\n", "module top_module (\n input a,\n input b,\n input cin,\n output cout,\n output sum\n);\n assign sum = a ^ b ^ cin;\n assign cout = (a & b) | (cin & (a ^ b));\nendmodule\n", "module top_module (\n input a,\n input b,\n input cin,\n output cout,\n output sum\n);\n\nassign sum = a ^ b ^ cin;\nassign cout = (a & b) | (cin & (a ^ b));\n\nendmodule\n", "module top_module (\n\tinput a,\n\tinput b,\n\tinput cin,\n\toutput cout,\n\toutput sum\n);\n\nassign sum = a ^ b ^ cin;\nassign cout = (a & b) | (cin & (a ^ b));\n\nendmodule\n", "module top_module (\n\tinput a,\n\tinput b,\n\tinput cin,\n\toutput cout,\n\toutput sum\n);\n\tassign sum = a ^ b ^ cin;\n\tassign cout = (a & b) | (cin & (a ^ b));\nendmodule\n", "module top_module (\n\tinput a,\n\tinput b,\n\tinput cin,\n\toutput cout,\n\toutput sum\n);\n assign sum = a ^ b ^ cin;\n assign cout = (a & b) | (cin & (a ^ b));\nendmodule\n", "module top_module (\n input a,\n input b,\n input cin,\n output cout,\n output sum\n);\n assign sum = a ^ b ^ cin;\n assign cout = (a & b) | (cin & (a ^ b));\nendmodule\n", "module top_module (\n\tinput a,\n\tinput b,\n\tinput cin,\n\toutput cout,\n\toutput sum\n);\n\tassign sum = a ^ b ^ cin;\n\tassign cout = (a & b) | (cin & (a ^ b));\nendmodule\n", "module top_module (\n\tinput a,\n\tinput b,\n\tinput cin,\n\toutput cout,\n\toutput sum\n);\n\tassign sum = a ^ b ^ cin;\n\tassign cout = (a & b) | (cin & (a ^ b));\nendmodule\n", "module top_module (\n input a,\n input b,\n input cin,\n output cout,\n output sum\n);\n assign sum = a ^ b ^ cin;\n assign cout = (a & b) | (cin & (a ^ b));\nendmodule\n", "module top_module (\n\tinput a,\n\tinput b,\n\tinput cin,\n\toutput cout,\n\toutput sum\n);\n\tassign sum = a ^ b ^ cin;\n\tassign cout = (a & b) | (cin & (a ^ b));\nendmodule\n", "module top_module (\n input a,\n input b,\n input cin,\n output cout,\n output sum\n);\n\nassign sum = a ^ b ^ cin;\nassign cout = (a & b) | (cin & (a ^ b));\n\nendmodule\n"]}
{"task_id": "m2014_q4g", "llmgen_RTL": ["module top_module (\n input in1,\n input in2,\n input in3,\n output logic out\n);\n logic xnor_output;\n\n assign xnor_output = ~(in1 ^ in2);\n assign out = xnor_output ^ in3;\n\nendmodule\n", "module top_module (\n\tinput in1,\n\tinput in2,\n\tinput in3,\n\toutput logic out\n);\n logic xnor_out;\n\n xnor(xnor_out, in1, in2);\n xor(out, xnor_out, in3);\nendmodule\n", "module top_module (\n input in1,\n input in2,\n input in3,\n output logic out\n);\n logic xnor_out;\n\n assign xnor_out = ~(in1 ^ in2);\n assign out = xnor_out ^ in3;\n\nendmodule\n", "module top_module (\n input in1,\n input in2,\n input in3,\n output logic out\n);\n logic xnor_out;\n \n assign xnor_out = ~(in1 ^ in2); // XNOR operation\n assign out = xnor_out ^ in3; // XOR with in3\nendmodule\n", "module top_module (\n input in1,\n input in2,\n input in3,\n output logic out\n);\n logic xnor_out;\n\n assign xnor_out = ~(in1 ^ in2);\n assign out = xnor_out ^ in3;\n \nendmodule\n", "module top_module (\n\tinput in1,\n\tinput in2,\n\tinput in3,\n\toutput logic out\n);\n logic xnor_out;\n\n assign xnor_out = ~(in1 ^ in2); // Two-input XNOR\n assign out = xnor_out ^ in3; // Two-input XOR\nendmodule\n", "module top_module (\n input in1,\n input in2,\n input in3,\n output logic out\n);\n logic xnor_out;\n\n assign xnor_out = ~(in1 ^ in2);\n assign out = xnor_out ^ in3;\n\nendmodule\n", "module top_module (\n\tinput in1,\n\tinput in2,\n\tinput in3,\n\toutput logic out\n);\n\n logic xnor_out;\n\n assign xnor_out = ~(in1 ^ in2);\n assign out = xnor_out ^ in3;\n\nendmodule\n", "module top_module (\n\tinput in1,\n\tinput in2,\n\tinput in3,\n\toutput logic out\n);\n logic xnor_out;\n\n // Two-input XNOR\n assign xnor_out = ~(in1 ^ in2);\n\n // Two-input XOR\n assign out = xnor_out ^ in3;\n\nendmodule\n", "module top_module (\n\tinput in1,\n\tinput in2,\n\tinput in3,\n\toutput logic out\n);\n logic xnor_out;\n\n assign xnor_out = ~(in1 ^ in2); // XNOR of in1 and in2\n assign out = xnor_out ^ in3; // XOR of xnor_out and in3\nendmodule\n", "module top_module (\n\tinput in1,\n\tinput in2,\n\tinput in3,\n\toutput logic out\n);\n logic xnor_out;\n\n assign xnor_out = in1 ~^ in2; // XNOR of in1 and in2\n assign out = xnor_out ^ in3; // XOR of xnor_out and in3\nendmodule\n", "module top_module (\n\tinput in1,\n\tinput in2,\n\tinput in3,\n\toutput logic out\n);\n logic xnor_out;\n\n assign xnor_out = ~(in1 ^ in2);\n assign out = xnor_out ^ in3;\n\nendmodule\n", "module top_module (\n\tinput in1,\n\tinput in2,\n\tinput in3,\n\toutput logic out\n);\n logic xnor_out;\n\n assign xnor_out = ~(in1 ^ in2);\n assign out = xnor_out ^ in3;\n\nendmodule\n", "module top_module (\n\tinput in1,\n\tinput in2,\n\tinput in3,\n\toutput logic out\n);\n\nlogic xnor_out;\n\nassign xnor_out = ~(in1 ^ in2);\nassign out = xnor_out ^ in3;\n\nendmodule\n", "module top_module (\n\tinput in1,\n\tinput in2,\n\tinput in3,\n\toutput logic out\n);\n\n logic xnor_out;\n\n assign xnor_out = ~(in1 ^ in2); // XNOR of in1 and in2\n assign out = xnor_out ^ in3; // XOR with in3\n\nendmodule\n", "module top_module (\n input in1,\n input in2,\n input in3,\n output logic out\n);\n logic xnor_out;\n \n assign xnor_out = ~(in1 ^ in2);\n assign out = xnor_out ^ in3;\n\nendmodule\n", "module top_module (\n\tinput in1,\n\tinput in2,\n\tinput in3,\n\toutput logic out\n);\n\nlogic xnor_out;\n\nassign xnor_out = ~(in1 ^ in2);\nassign out = xnor_out ^ in3;\n\nendmodule\n", "module top_module (\n\tinput in1,\n\tinput in2,\n\tinput in3,\n\toutput logic out\n);\n\twire xnor_out;\n\n\tassign xnor_out = ~(in1 ^ in2); // XNOR operation\n\tassign out = xnor_out ^ in3; // XOR operation\nendmodule\n", "module top_module (\n\tinput in1,\n\tinput in2,\n\tinput in3,\n\toutput logic out\n);\n\nlogic xnor_out;\n\nassign xnor_out = !(in1 ^ in2); // XNOR implementat
{"task_id": "ece241_2014_q3", "llmgen_RTL": ["module top_module (\n input c,\n input d,\n output [3:0] mux_in\n);\n assign mux_in[0] = 1'b0; // ab = 00\n assign mux_in[1] = 1'b1; // ab = 01\n assign mux_in[2] = (c & d); // ab = 11\n assign mux_in[3] = (c & ~d); // ab = 10\nendmodule\n", "module top_module (\n input c,\n input d,\n output [3:0] mux_in\n);\n assign mux_in[0] = 0; // ab = 00\n assign mux_in[1] = 1; // ab = 01\n assign mux_in[2] = (c & d); // ab = 10 (c & d = 1 if cd = 11)\n assign mux_in[3] = 1; // ab = 11\n\nendmodule\n", "module top_module (\n input c,\n input d,\n output [3:0] mux_in\n);\n assign mux_in[0] = 0; // ab = 00\n assign mux_in[1] = 1; // ab = 01\n assign mux_in[2] = (c & d); // ab = 11\n assign mux_in[3] = (c & ~d); // ab = 10\nendmodule\n", "module top_module (\n input c,\n input d,\n output [3:0] mux_in\n);\n assign mux_in[0] = 1'b0; // ab = 00\n assign mux_in[1] = c; // ab = 01\n assign mux_in[2] = (c & d); // ab = 11\n assign mux_in[3] = 1'b1; // ab = 10\nendmodule\n", "module top_module (\n input c,\n input d,\n output [3:0] mux_in\n);\n assign mux_in[0] = 0; // ab = 00\n assign mux_in[1] = 1; // ab = 01\n assign mux_in[2] = (c & d); // ab = 11\n assign mux_in[3] = c; // ab = 10\nendmodule\n", "module top_module (\n\tinput c,\n\tinput d,\n\toutput [3:0] mux_in\n);\n\tassign mux_in[0] = 0; // ab = 00\n\tassign mux_in[1] = 1; // ab = 01\n\tassign mux_in[2] = c & d; // ab = 11\n\tassign mux_in[3] = c; // ab = 10\nendmodule\n", "module top_module (\n input c,\n input d,\n output [3:0] mux_in\n);\n assign mux_in[0] = 0; // ab = 00\n assign mux_in[1] = 1; // ab = 01\n assign mux_in[2] = c & d; // ab = 10\n assign mux_in[3] = c | d; // ab = 11\nendmodule\n", "module top_module (\n input c,\n input d,\n output [3:0] mux_in\n);\n assign mux_in[0] = 0; // ab = 00\n assign mux_in[1] = c; // ab = 01\n assign mux_in[2] = (c & d); // ab = 10 -> c & d\n assign mux_in[3] = (c | d); // ab = 11 -> c | d\nendmodule\n", "module top_module (\n input c,\n input d,\n output [3:0] mux_in\n);\n assign mux_in[0] = 1'b0; // ab = 00\n assign mux_in[1] = 1'b1; // ab = 01\n assign mux_in[2] = (c & d); // ab = 11 (c & d) corresponds to 1 (c=1, d=1)\n assign mux_in[3] = (c & ~d); // ab = 10 (c & ~d) corresponds to 1 (c=1, d=0)\nendmodule\n", "module top_module (\n input c,\n input d,\n output [3:0] mux_in\n);\n assign mux_in[0] = 0; // ab = 00\n assign mux_in[1] = c; // ab = 01\n assign mux_in[2] = c & d; // ab = 11\n assign mux_in[3] = c; // ab = 10\nendmodule\n", "module top_module (\n\tinput c,\n\tinput d,\n\toutput [3:0] mux_in\n);\n assign mux_in[0] = 0; // ab = 00\n assign mux_in[1] = 1; // ab = 01\n assign mux_in[2] = (c & d); // ab = 10, corresponds to K-map (1, 0, 0, 1)\n assign mux_in[3] = (c | d); // ab = 11, corresponds to K-map (1, 0, 1, 1)\nendmodule\n", "module top_module (\n input c,\n input d,\n output [3:0] mux_in\n);\n\n assign mux_in[0] = 0; // ab = 00\n assign mux_in[1] = c; // ab = 01\n assign mux_in[2] = c & d; // ab = 11\n assign mux_in[3] = d; // ab = 10\n\nendmodule\n", "module top_module (\n input c,\n input d,\n output [3:0] mux_in\n);\n assign mux_in[0] = 1'b0; // ab = 00\n assign mux_in[1] = c; // ab = 01\n assign mux_in[2] = (c & d); // ab = 11\n assign mux_in[3] = d; // ab = 10\nendmodule\n", "module top_module (\n input c,\n input d,\n output [3:0] mux_in\n);\n assign mux_in[0] = 0; // ab = 00\n assign mux_in[1] = c; // ab = 01\n assign mux_in[2] = c & d; // ab = 11\n assign mux_in[3] = c; // ab = 10\nendmodule\n", "module top_module (\n\tinput c,\n\tinput d,\n\toutput [3:0] mux_in\n);\n\tassign mux_in[0] = 1'b0; // ab = 00\n\tassign mux_in[1] = 1'b1; // ab = 01\n\tassign mux_in[2] = d; // ab = 11\n\tassign mux_in[3] = c; // ab = 10\nendmodule\n", "module
{"task_id": "ece241_2014_q5b", "llmgen_RTL": ["module top_module (\n input clk,\n input areset,\n input x,\n output reg z\n);\n \n // State encoding\n reg [1:0] state; // One-hot encoding for 2 states\n parameter A = 2'b01, B = 2'b10;\n\n always @(posedge clk or posedge areset) begin\n if (areset) begin\n state <= A; // Reset to state A\n z <= 1'b0; // Z is 0 in state A\n end else begin\n case (state)\n A: begin\n if (x) begin\n state <= B;\n z <= 1'b1; // Output z=1 when transitioning from A to B on x=1\n end else begin\n state <= A; \n z <= 1'b0; // Stay in A with z=0\n end\n end\n B: begin\n state <= B; // Stay in B regardless of x\n z <= x ? 1'b0 : 1'b1; // z=0 if x=1, z=1 if x=0\n end\n endcase\n end\n end\n\nendmodule\n", "module top_module (\n input clk,\n input areset,\n input x,\n output reg z\n);\n\n reg [1:0] state, next_state; // One-hot encoding for two states\n\n // State encoding\n localparam A = 2'b01, B = 2'b10;\n\n // Asynchronous reset\n always @ (posedge clk or posedge areset) begin\n if (areset)\n state <= A; // Reset to state A\n else\n state <= next_state; // Transition to next state\n end\n\n // Combinational logic for state transition and output\n always @ (*) begin\n case (state)\n A: begin\n if (x) begin\n next_state = B;\n z = 1;\n end else begin\n next_state = A;\n z = 0;\n end\n end\n B: begin\n next_state = B; // Stay in state B\n z = (x) ? 0 : 1; // Output z based on x\n end\n default: begin\n next_state = A;\n z = 0;\n end\n endcase\n end\n\nendmodule\n", "module top_module (\n input clk,\n input areset,\n input x,\n output reg z\n);\n\n // State Encoding\n localparam A = 2'b01;\n localparam B = 2'b10;\n\n reg [1:0] state, next_state;\n\n always @(posedge clk or posedge areset) begin\n if (areset) begin\n state <= A;\n end else begin\n state <= next_state;\n end\n end\n\n always @(*) begin\n case (state)\n A: begin\n z = (x == 1'b1) ? 1'b1 : 1'b0;\n next_state = (x == 1'b1) ? B : A;\n end\n B: begin\n z = (x == 1'b0) ? 1'b1 : 1'b0;\n next_state = B;\n end\n default: begin\n z = 1'b0;\n next_state = A;\n end\n endcase\n end\nendmodule\n", "module top_module (\n input clk,\n input areset,\n input x,\n output reg z\n);\n\n // State declaration using one-hot encoding\n reg [1:0] state, next_state;\n\n parameter A = 2'b01, B = 2'b10;\n\n // Asynchronous reset and state transition\n always @(posedge clk or posedge areset) begin\n if (areset)\n state <= A; // Reset state to A\n else\n state <= next_state; // Transition to next state\n end\n\n // Next state logic\n always @(*) begin\n case (state)\n A: begin\n if (x) begin\n next_state = B;\n z = 1;\n end else begin\n next_state = A;\n z = 0;\n end\n end\n B: begin\n next_state = B; // Stay in B\n z = (x) ? 0 : 1; // Output logic\n end\n default: begin\n next_state = A; // Default state handling\n z = 0; // Default out
{"task_id": "circuit10", "llmgen_RTL": ["module top_module (\n input clk,\n input a,\n input b,\n output reg q,\n output reg state\n);\n\n always @(posedge clk) begin\n state <= (state == 1 && b == 1) ? 0 : (state == 0 && a == 1) ? 1 : state;\n q <= (state == 1 && b == 1) ? 1 : (state == 0 && a == 1) ? 0 : q;\n end\n\n initial begin\n state = 0;\n q = 0;\n end\n\nendmodule\n", "module top_module (\n input clk,\n input a,\n input b,\n output reg q,\n output reg state\n);\n \n always @(posedge clk) begin\n if (a && !b) begin\n q <= 1;\n state <= 0;\n end else if (!a && b) begin\n q <= 0;\n state <= 1;\n end else if (a && b) begin\n q <= 0;\n state <= 0;\n end else begin\n q <= q; // retain previous value\n state <= state; // retain previous value\n end\n end\nendmodule\n", "module top_module (\n input clk,\n input a,\n input b,\n output reg q,\n output reg state\n);\n\nreg flip_flop;\n\nalways @(posedge clk) begin\n if (a && !b) begin\n flip_flop <= 1;\n q <= 1;\n state <= 1;\n end else if (!a && b) begin\n flip_flop <= 0;\n q <= 0;\n state <= 1;\n end else if (a && b) begin\n if (flip_flop) begin\n q <= 0;\n state <= 0;\n end else begin\n q <= 1;\n state <= 0;\n end\n end else begin\n q <= flip_flop;\n state <= flip_flop;\n end\nend\n\nendmodule\n", "module top_module (\n input clk,\n input a,\n input b,\n output reg q,\n output reg state\n);\n reg ff;\n\n always @(posedge clk) begin\n ff <= (a & b) ? 1 : (ff & ~b);\n q <= ff;\n state <= ff;\n end\nendmodule\n", "module top_module (\n input clk,\n input a,\n input b,\n output reg q,\n output reg state\n);\n always @(posedge clk) begin\n // State transition logic\n if (a && b) begin\n q <= 0;\n state <= 1;\n end else if (!a && !b) begin\n q <= 0;\n state <= 0;\n end else if (a && !b) begin\n q <= 1;\n state <= 0;\n end else if (!a && b) begin\n q <= 1;\n state <= 1;\n end\n end\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput a,\n\tinput b,\n\toutput reg q,\n\toutput reg state\n);\n\n\treg ff;\n\n\talways @(posedge clk) begin\n\t\tif (a && !b) begin\n\t\t\tff <= 1;\n\t\tend else if (!a && b) begin\n\t\t\tff <= 0;\n\t\tend\n\t\tq <= ff;\n\t\tstate <= (a && b) ? 1 : 0;\n\tend\n\nendmodule\n", "module top_module (\n input clk,\n input a,\n input b,\n output reg q,\n output reg state\n);\n\n always @(posedge clk) begin\n if (a && !b) begin\n q <= 1;\n state <= 0;\n end else if (!a && b) begin\n q <= 0;\n state <= 1;\n end else if (a && b) begin\n q <= 1;\n state <= 1;\n end else begin\n q <= 0;\n state <= 0;\n end\n end\nendmodule\n", "module top_module (\n input clk,\n input a,\n input b,\n output reg q,\n output reg state\n);\n\n always @(posedge clk) begin\n if (a && !b) begin\n q <= 1;\n state <= 0;\n end else if (a && b) begin\n q <= 0;\n state <= 1;\n end else if (!a && !b) begin\n q <= q;\n state <= state;\n end else if (!a && b) begin\n q <= 0;\n state <= 1;\n end\n end\n\nendmodule\n", "module top_module (\n input clk,\n input a,\n input b,\n output reg q,\n output reg state\n);\n\n always @(posedge clk) begin\n if (a && !b) begin\n q <= 1'b1;\n state <= 1'b0;\n end else if (!a && !b) begin\n q <= 1'b0;\n state <= 1'b0;\n end else if (a && b) begin\n
{"task_id": "2012_q1g", "llmgen_RTL": ["module top_module (\n input [4:1] x,\n output logic f\n);\n always @* begin\n case ({x[4], x[3], x[2], x[1]})\n 4'b0000: f = 1;\n 4'b0001: f = 0;\n 4'b0010: f = 0;\n 4'b0011: f = 1;\n 4'b0100: f = 0;\n 4'b0101: f = 0;\n 4'b0110: f = 0;\n 4'b0111: f = 0;\n 4'b1000: f = 1;\n 4'b1001: f = 1;\n 4'b1010: f = 0;\n 4'b1011: f = 1;\n 4'b1100: f = 1;\n 4'b1101: f = 1;\n 4'b1110: f = 1;\n 4'b1111: f = 0;\n default: f = 0;\n endcase\n end\nendmodule\n", "module top_module (\n input [4:1] x,\n output logic f\n);\n assign f = (x[4:3] == 2'b00 && x[2:1] == 2'b00) || \n (x[4:3] == 2'b00 && x[2:1] == 2'b10) || \n (x[4:3] == 2'b11 && x[2:1] == 2'b01) || \n (x[4:3] == 2'b11 && x[2:1] == 2'b00) || \n (x[4:3] == 2'b10 && x[2:1] == 2'b00) || \n (x[4:3] == 2'b10 && x[2:1] == 2'b01);\nendmodule\n", "module top_module (\n\tinput [4:1] x,\n\toutput logic f\n);\n\tassign f = (x[4:1] == 4'b0000) || (x[4:1] == 4'b0010) || (x[4:1] == 4'b1100) || \n\t (x[4:1] == 4'b1101) || (x[4:1] == 4'b1000) || (x[4:1] == 4'b1001);\nendmodule\n", "module top_module (\n input [4:1] x,\n output logic f\n);\n assign f = (x[4] == 0 && x[3] == 0 && x[2] == 0 && x[1] == 0) || // 1 at 00 00\n (x[4] == 0 && x[3] == 0 && x[2] == 1 && x[1] == 0) || // 1 at 00 10\n (x[4] == 1 && x[3] == 1 && x[2] == 0 && x[1] == 0) || // 1 at 10 00\n (x[4] == 1 && x[3] == 1 && x[2] == 0 && x[1] == 1) || // 1 at 10 01\n (x[4] == 1 && x[3] == 1 && x[2] == 1 && x[1] == 0) || // 1 at 11 00\n (x[4] == 0 && x[3] == 1 && x[2] == 1 && x[1] == 0) || // 1 at 01 11\n (x[4] == 1 && x[3] == 0 && x[2] == 1 && x[1] == 1); // 1 at 10 11\nendmodule\n", "module top_module (\n\tinput [4:1] x,\n\toutput logic f\n);\n\n\tassign f = (x[4] == 0 && x[3] == 0 && x[2] == 0 && x[1] == 0) || \n\t (x[4] == 0 && x[3] == 0 && x[2] == 1 && x[1] == 0) ||\n\t (x[4] == 1 && x[3] == 1 && x[2] == 0 && x[1] == 0) ||\n\t (x[4] == 0 && x[3] == 1 && x[2] == 1 && x[1] == 0) ||\n\t (x[4] == 1 && x[3] == 0 && x[2] == 0 && x[1] == 0) ||\n\t (x[4] == 1 && x[3] == 0 && x[2] == 1 && x[1] == 1) ||\n\t (x[4] == 1 && x[3] == 1 && x[2] == 1 && x[1] == 1) ||\n\t (x[4] == 0 && x[3] == 1 && x[2] == 1 && x[1] == 1);\n\nendmodule\n", "module top_module (\n\tinput [4:1] x,\n\toutput logic f\n);\n\tassign f = (x[4:3] == 2'b00 && (x[2:1] == 2'b00 || x[2:1] == 2'b10)) || \n (x[4:3] == 2'b11) || \n (x[4:3] == 2'b10 && (x[2:1] == 2'b10 || x[2:1] == 2'b01));\nendmodule\n", "module top_module (\n input [4:1] x,\n output logic f\n);\n always_comb begin\n case ({x[4], x[3], x[2], x[1]})\n 4'b0000: f = 1; // 1\n 4'b0001: f = 0; // 0\n 4'b0010: f = 0; // 0\n 4'b0011: f = 1; // 1\n 4'b0100: f = 0; // 0\n 4'b0101: f = 0; // 0\n 4'b0110: f = 0; // 0\n 4'b0111: f = 0; // 0\n 4'b1000: f = 1; // 1\n 4'b1001: f = 1; // 1\n 4'b1010: f = 0; // 0\n 4'b1011: f = 1; // 1\n 4'b1100: f = 1; // 1\n 4'b1101: f = 1; // 1\n 4'b1110: f = 1; // 0\n 4'b1111: f = 0; // 0\n default: f = 0;\n endcase\n end\nendmodule\n", "module top_module (\n input [4:1] x,\n output logic f\n);\n assign f = (x[4] == 0 && x[3] == 0 && x[2] == 0 && x[1] == 0) || \n (x[4] == 0 && x[3] == 0 && x[2] == 1 && x[1] == 0) || \n (x[4] == 1 && x[3] == 0 && x[2] == 1 && x[1] == 1) || \n (x[4] == 1 && x[3] == 0 && x[2] == 0 && x[1] == 1) || \n (x[4] == 1 && x[3] == 1 && x[2] == 1) || \n
{"task_id": "fsm_hdlc", "llmgen_RTL": ["module top_module (\n input clk,\n input reset,\n input in,\n output reg disc,\n output reg flag,\n output reg err\n);\n\n reg [3:0] state, next_state;\n \n // Define states\n parameter S0 = 4'b0000; // Initial state, expect 0\n parameter S1 = 4'b0001; // 0 followed by 1\n parameter S2 = 4'b0010; // 01\n parameter S3 = 4'b0011; // 011\n parameter S4 = 4'b0100; // 0111\n parameter S5 = 4'b0101; // 01111\n parameter S6 = 4'b0110; // 011111\n parameter S7 = 4'b0111; // 0111111 (error state)\n parameter S8 = 4'b1000; // 01111110 (flag state)\n\n // State transition logic\n always @(*) begin\n next_state = state; // Default to current state\n disc = 0;\n flag = 0;\n err = 0;\n \n case (state)\n S0: if (in) next_state = S1; // Start of 1 sequence\n S1: if (in) next_state = S2; else next_state = S0; // 1 followed by 0\n S2: if (in) next_state = S3; else next_state = S0; // 01 followed by 0\n S3: if (in) next_state = S4; else next_state = S0; // 011 followed by 0\n S4: if (in) next_state = S5; else next_state = S0; // 0111 followed by 0\n S5: if (in) next_state = S6; else next_state = S0; // 01111 followed by 0\n S6: if (in) next_state = S8; else begin next_state = S0; disc = 1; end // 011111 followed by 1 (disc)\n S7: begin next_state = S7; err = 1; end // Stay in error state\n S8: begin next_state = S0; flag = 1; end // 01111110, back to start\n default: next_state = S0;\n endcase\n end\n\n // State register\n always @(posedge clk) begin\n if (reset) \n state <= S0;\n else \n state <= next_state;\n end\n\n // Output control to ensure they assert for a complete cycle\n always @(posedge clk) begin\n if (reset) begin\n disc <= 0;\n flag <= 0;\n err <= 0;\n end else begin\n if (disc) disc <= 1;\n else disc <= 0;\n\n if (flag) flag <= 1;\n else flag <= 0;\n\n if (err) err <= 1;\n else err <= 0;\n end\n end\n\nendmodule\n", "module top_module (\n input clk,\n input reset,\n input in,\n output reg disc,\n output reg flag,\n output reg err\n);\n\n typedef enum logic [2:0] {\n IDLE,\n ONE,\n TWO,\n THREE,\n FOUR,\n FIVE,\n SIX,\n ERROR\n } state_t;\n\n state_t state, next_state;\n\n always_ff @(posedge clk or posedge reset) begin\n if (reset) begin\n state <= IDLE;\n disc <= 0;\n flag <= 0;\n err <= 0;\n end else begin\n state <= next_state;\n end\n end\n\n always_comb begin\n next_state = state;\n disc = 0;\n flag = 0;\n err = 0;\n\n case (state)\n IDLE: begin\n if (in) next_state = ONE;\n end\n ONE: begin\n if (in) next_state = TWO;\n else next_state = IDLE;\n end\n TWO: begin\n if (in) next_state = THREE;\n else next_state = IDLE;\n end\n THREE: begin\n if (in) next_state = FOUR;\n else next_state = IDLE;\n end\n FOUR: begin\n if (in) next_state = FIVE;\n else next_state = IDLE;\n end\n FIVE: begin\n if (in) next_state = SIX;\n else next_state = IDLE;\n end\n SIX: begin\n if (in) next_state = ERROR; // 7 or more 1s\n else begin\n disc = 1;\n next_state = IDLE;\n end\n end\n ERROR: begin\n err = 1;\n next_state = IDLE;\n end\n endcase\n\n if (stat
{"task_id": "review2015_fancytimer", "llmgen_RTL": ["module top_module(\n input wire clk,\n input wire reset,\n input wire data,\n output wire [3:0] count,\n output reg counting,\n output reg done,\n input wire ack\n);\n\n reg [3:0] delay;\n reg [3:0] current_count;\n reg [2:0] state, next_state;\n reg [19:0] clk_counter;\n\n localparam IDLE = 3'b000, \n SEARCH = 3'b001, \n LOAD_DELAY = 3'b010, \n COUNTING = 3'b011, \n DONE = 3'b100;\n\n always @(posedge clk) begin\n if (reset) begin\n state <= IDLE;\n counting <= 0;\n done <= 0;\n clk_counter <= 0;\n current_count <= 0;\n delay <= 0;\n end else begin\n state <= next_state;\n end\n end\n\n always @(state or data or current_count or ack) begin\n case (state)\n IDLE: begin\n counting = 0;\n done = 0;\n clk_counter = 0;\n current_count = 0;\n next_state = SEARCH;\n end\n\n SEARCH: begin\n if (data == 1) begin\n next_state = LOAD_DELAY;\n end else begin\n next_state = SEARCH;\n end\n end\n\n LOAD_DELAY: begin\n next_state = (data == 1) ? COUNTING : LOAD_DELAY;\n if (data == 1) begin\n delay <= {data, delay[3:1]};\n end\n end\n\n COUNTING: begin\n counting = 1;\n if (clk_counter < (delay + 1) * 1000) begin\n if (clk_counter % 1000 == 0) begin\n current_count = (delay == 0) ? 0 : delay;\n delay = (delay > 0) ? delay - 1 : 0;\n end\n clk_counter <= clk_counter + 1;\n next_state = COUNTING;\n end else begin\n done = 1;\n counting = 0;\n next_state = DONE;\n end\n end\n\n DONE: begin\n if (ack) begin\n next_state = SEARCH;\n end else begin\n next_state = DONE;\n end\n end\n \n default: next_state = IDLE;\n endcase\n end\n\n assign count = (counting) ? current_count : 4'bx;\n\nendmodule\n", "module top_module(\n input wire clk,\n input wire reset,\n input wire data,\n output reg [3:0] count,\n output reg counting,\n output reg done,\n input wire ack\n);\n\n reg [3:0] delay;\n reg [3:0] state;\n reg [9:0] cycle_counter;\n reg [3:0] time_remaining;\n \n parameter IDLE = 4'b0000, SEARCH = 4'b0001, SHIFT = 4'b0010, COUNT = 4'b0011, DONE = 4'b0100;\n\n always @(posedge clk) begin\n if (reset) begin\n state <= IDLE;\n counting <= 0;\n done <= 0;\n count <= 4'bxxxx; // don't care\n cycle_counter <= 10'd0;\n time_remaining <= 4'd0;\n end else begin\n case (state)\n IDLE: begin\n counting <= 0;\n done <= 0;\n count <= 4'bxxxx; // don't care\n if (data == 1'b1) state <= SEARCH;\n end\n SEARCH: begin\n if (data == 1'b1) state <= SHIFT;\n else if (data == 1'b0) state <= SEARCH;\n end\n SHIFT: begin\n if (delay === 4'bxxxx) begin // if we haven't loaded shift bits yet\n delay <= 0; // clear delay for shifting\n end else if (time_remaining < 4'd4) begin\n delay <= {delay[2:0], data}; // shift in data\n time_remaining <= time_remaining + 1'b1;\n if (time_remaining == 4'd3)
{"task_id": "ece241_2013_q4", "llmgen_RTL": ["module top_module (\n\tinput clk,\n\tinput reset,\n\tinput [3:1] s,\n\toutput reg fr3,\n\toutput reg fr2,\n\toutput reg fr1,\n\toutput reg dfr\n);\n \n typedef enum reg [1:0] {\n LOW, // Below s[1]\n BETWEEN_12, // Between s[2] and s[1]\n BETWEEN_23, // Between s[3] and s[2]\n HIGH // Above s[3]\n } state_t;\n \n state_t state, next_state;\n reg [3:1] last_s;\n \n always @(posedge clk or posedge reset) begin\n if (reset) begin\n state <= LOW;\n fr3 <= 1;\n fr2 <= 1;\n fr1 <= 1;\n dfr <= 0;\n last_s <= 3'b000;\n end else begin\n state <= next_state;\n last_s <= s;\n end\n end\n \n always @(*) begin\n case (state)\n LOW: begin\n if (s[1]) next_state = BETWEEN_12;\n else if (s[2]) next_state = BETWEEN_23;\n else if (s[3]) next_state = HIGH;\n else next_state = LOW;\n end\n \n BETWEEN_12: begin\n if (s[1]) next_state = BETWEEN_12;\n else if (s[2]) next_state = BETWEEN_23;\n else if (s[3]) next_state = HIGH;\n else next_state = LOW;\n end\n \n BETWEEN_23: begin\n if (s[3]) next_state = HIGH;\n else if (s[2]) next_state = BETWEEN_23;\n else if (s[1]) next_state = BETWEEN_12;\n else next_state = LOW;\n end\n \n HIGH: begin\n next_state = HIGH;\n end\n \n default: next_state = LOW;\n endcase\n end\n\n always @(posedge clk) begin\n case (state)\n LOW: begin\n fr3 <= 1;\n fr2 <= 1;\n fr1 <= 1;\n dfr <= 0;\n end\n \n BETWEEN_12: begin\n fr3 <= 1;\n fr2 <= 1;\n fr1 <= 1;\n dfr <= (last_s < s) ? 1 : 0; // Increase flow if the level has risen\n end\n \n BETWEEN_23: begin\n fr3 <= 0;\n fr2 <= 1;\n fr1 <= 1;\n dfr <= (last_s < s) ? 1 : 0; // Increase flow if the level has risen\n end\n \n HIGH: begin\n fr3 <= 0;\n fr2 <= 0;\n fr1 <= 0;\n dfr <= 0; // No flow allowed above highest sensor\n end\n \n default: begin\n fr3 <= 1;\n fr2 <= 1;\n fr1 <= 1;\n dfr <= 0;\n end\n endcase\n end\n \nendmodule\n", "module top_module (\n input clk,\n input reset,\n input [3:1] s,\n output reg fr3,\n output reg fr2,\n output reg fr1,\n output reg dfr\n);\n\n reg [1:0] prev_state; // 0: lower, 1: middle, 2: upper\n reg [1:0] current_state; // 0: None, 1: s[1], 2: s[2], 3: s[3]\n\n always @(posedge clk or posedge reset) begin\n if (reset) begin\n fr3 <= 1;\n fr2 <= 1;\n fr1 <= 1;\n dfr <= 0;\n current_state <= 0; // reset state to below s[1]\n prev_state <= 0;\n end else begin\n prev_state <= current_state;\n\n if (s[3]) begin\n // Above s[3]\n fr3 <= 0;\n fr2 <= 0;\n fr1 <= 0;\n dfr <= 0;\n current_state <= 3;\n end else if (s[2]) begin\n // Between s[3] and s[2]\n fr3 <= 0;\n fr2 <= 0;\n fr1 <= 1;\n dfr <= (prev_state < 3) ? 1 : 0; // If previous level was lower\n current_state <= 2;\n end else if (s[1]) begin\n // Between s[2] and s[1]\n fr3 <= 0;\n
{"task_id": "fsm_serial", "llmgen_RTL": ["module top_module (\n input clk,\n input in,\n input reset,\n output done\n);\n typedef enum logic [2:0] {\n IDLE = 3'b000,\n START_BIT = 3'b001,\n DATA_BITS = 3'b010,\n CHECK_STOP = 3'b011,\n DONE = 3'b100\n } state_t;\n\n state_t state, next_state;\n logic [3:0] bit_count; // Count of received bits (0 for start bit, 1-8 for data bits)\n \n assign done = (state == DONE);\n\n always_ff @(posedge clk or posedge reset) begin\n if (reset) begin\n state <= IDLE;\n bit_count <= 4'b0000;\n end else begin\n state <= next_state;\n end\n end\n\n always_comb begin\n next_state = state;\n case (state)\n IDLE: begin\n if (in == 1'b0) // Detect start bit\n next_state = START_BIT;\n end\n\n START_BIT: begin\n if (in == 1'b1) // Transition to data bits on next clock\n next_state = DATA_BITS;\n end\n\n DATA_BITS: begin\n if (bit_count < 4'd8) begin\n if (clk) // Sample data bit on clk edge\n bit_count = bit_count + 1;\n end else begin\n next_state = CHECK_STOP;\n end\n end\n\n CHECK_STOP: begin\n if (in == 1'b1) // Check stop bit\n next_state = DONE;\n else begin\n bit_count = 4'b0000; // Reset bit count if stop bit not received\n next_state = IDLE; // Wait for a new start bit\n end\n end\n \n DONE: begin\n bit_count = 4'b0000; // Reset bit count\n next_state = IDLE; // Go back to idle after done\n end\n \n endcase\n end\n\nendmodule\n", "module top_module (\n\tinput clk,\n\tinput in,\n\tinput reset,\n\toutput reg done\n);\n \n\t// State encoding\n\ttypedef enum reg [1:0] {\n\t\tIDLE = 2'b00,\n\t\tSTART_BIT = 2'b01,\n\t\tDATA_BITS = 2'b10,\n\t\tSTOP_BIT = 2'b11\n\t} state_t;\n\n\tstate_t current_state, next_state;\n\treg [3:0] bit_count; // Count of bits received (0 to 8)\n\n\t// State transition\n\talways @(posedge clk or posedge reset) begin\n\t\tif (reset) begin\n\t\t\tcurrent_state <= IDLE;\n\t\t\tbit_count <= 0;\n\t\t\tdone <= 0;\n\t\tend else begin\n\t\t\tcurrent_state <= next_state;\n\t\tend\n\tend\n\n\t// Next state logic\n\talways @* begin\n\t\tnext_state = current_state;\n\t\tdone = 0;\n\n\t\tcase (current_state)\n\t\t\tIDLE: begin\n\t\t\t\tif (in == 0) begin // Start bit detected\n\t\t\t\t\tnext_state = START_BIT;\n\t\t\t\t\tbit_count = 0;\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tSTART_BIT: begin\n\t\t\t\tif (in == 1) begin\n\t\t\t\t\tnext_state = DATA_BITS; // Transition to data bits\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tDATA_BITS: begin\n\t\t\t\tif (bit_count < 8) begin\n\t\t\t\t\tbit_count = bit_count + 1;\n\t\t\t\tend else begin\n\t\t\t\t\tnext_state = STOP_BIT; // All data bits received\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tSTOP_BIT: begin\n\t\t\t\tif (in == 1) begin // Stop bit detected\n\t\t\t\t\tdone = 1; // Byte received\n\t\t\t\t\tnext_state = IDLE; // Go back to idle\n\t\t\t\tend else begin\n\t\t\t\t\t// Stay in STOP_BIT state until correct stop bit is received\n\t\t\t\t\tnext_state = STOP_BIT;\n\t\t\t\tend\n\t\t\tend\n\t\tendcase\n\tend\n\nendmodule\n", "module top_module (\n input clk,\n input in,\n input reset,\n output reg done\n);\n\n typedef enum logic [2:0] {\n IDLE,\n START,\n DATA,\n STOP\n } state_t;\n\n state_t state, next_state;\n integer bit_count;\n\n always_ff @(posedge clk or posedge reset) begin\n if (reset) begin\n state <= IDLE;\n done <= 0;\n bit_count <= 0;\n end else begin\n state <= next_state;\n end\n end\n\n always_ff @(posedge clk) begin\n if (s
{"task_id": "fsm_serialdata", "llmgen_RTL": ["module top_module (\n input clk,\n input in,\n input reset,\n output reg [7:0] out_byte,\n output reg done\n);\n\n typedef enum reg [2:0] {\n IDLE,\n START,\n DATA,\n STOP\n } state_t;\n\n state_t current_state, next_state;\n reg [3:0] bit_count;\n\n always @(posedge clk or posedge reset) begin\n if (reset) begin\n current_state <= IDLE;\n out_byte <= 8'b0;\n done <= 1'b0;\n bit_count <= 4'b0;\n end else begin\n current_state <= next_state;\n end\n end\n\n always @(*) begin\n next_state = current_state;\n done = 1'b0;\n\n case (current_state)\n IDLE: begin\n if (in == 1'b0) begin\n next_state = START;\n end\n end\n \n START: begin\n if (in == 1'b1) begin\n next_state = IDLE; // Invalid start\n end else begin\n next_state = DATA;\n bit_count = 4'b0;\n end\n end\n \n DATA: begin\n if (bit_count < 4'd8) begin\n out_byte[bit_count] = in; // Capture data bits\n bit_count = bit_count + 1;\n end else begin\n next_state = STOP;\n end\n end\n \n STOP: begin\n done = 1'b1;\n if (in == 1'b1) begin\n next_state = IDLE;\n end else begin\n next_state = IDLE; // Invalid stop\n end\n end\n endcase\n end\n\nendmodule\n", "module top_module (\n input clk,\n input in,\n input reset,\n output reg [7:0] out_byte,\n output reg done\n);\n\n typedef enum logic [2:0] {\n IDLE,\n START_BIT,\n DATA_BITS,\n STOP_BIT,\n ERROR\n } state_t;\n\n state_t current_state, next_state;\n logic [3:0] bit_count;\n\n always_ff @(posedge clk or posedge reset) begin\n if (reset) begin\n current_state <= IDLE;\n out_byte <= 8'b0;\n done <= 0;\n bit_count <= 0;\n end else begin\n current_state <= next_state;\n end\n end\n\n always_ff @(posedge clk) begin\n if (current_state == DATA_BITS) begin\n out_byte[bit_count] <= in; // capture data bits\n end\n end\n\n always_ff @(posedge clk or posedge reset) begin\n if (reset) begin\n bit_count <= 0;\n end else if (current_state == DATA_BITS) begin\n bit_count <= bit_count + 1;\n end else if (current_state == IDLE) begin\n bit_count <= 0;\n end\n end\n\n always_comb begin\n case (current_state)\n IDLE: begin\n done = 0;\n if (in == 0) // Start bit detected\n next_state = START_BIT;\n else\n next_state = IDLE;\n end\n \n START_BIT: begin\n if (in == 0) // Still receiving start bit\n next_state = START_BIT;\n else // Start bit completed\n next_state = DATA_BITS;\n end\n \n DATA_BITS: begin\n if (bit_count == 7) // Received all 8 bits\n next_state = STOP_BIT;\n else\n next_state = DATA_BITS;\n end\n \n STOP_BIT: begin\n if (in == 1) begin // Stop bit received\n done = 1;\n next_state = IDLE; // Return to IDLE\n end else begin\n next_state = ERROR; // Stop bit not received\n end\n end\n \n ERROR: begin\n if (in == 1) // Find a stop bi
{"task_id": "gshare", "llmgen_RTL": ["module top_module(\n input clk,\n input areset, \n\n input predict_valid,\n input [6:0] predict_pc,\n output reg predict_taken, \n output reg [6:0] predict_history,\n\n input train_valid,\n input train_taken,\n input train_mispredicted,\n input [6:0] train_history, \n input [6:0] train_pc\n);\n\n reg [1:0] PHT[127:0]; // Pattern History Table with 128 entries of 2-bit saturating counters\n reg [6:0] global_history; // 7-bit global history register\n\n wire [6:0] predict_index = predict_pc ^ global_history; // Hashing the PC and global history\n wire [6:0] train_index = train_pc ^ train_history; // Hashing for training\n\n always @(posedge clk or posedge areset) begin\n if (areset) begin\n global_history <= 7'b0;\n for (int i = 0; i < 128; i++) begin\n PHT[i] <= 2'b00; // Initialize PHT to 0 (strongly not taken)\n end\n end else begin\n if (train_valid) begin\n if (train_mispredicted) begin\n // Recover history for misprediction\n global_history <= train_history;\n end else begin\n // Update history on correct prediction\n global_history <= {global_history[5:0], train_taken};\n end\n \n // Update PHT based on training outcome\n case (PHT[train_index])\n 2'b00: PHT[train_index] <= train_taken ? 2'b01 : 2'b00;\n 2'b01: PHT[train_index] <= train_taken ? 2'b10 : 2'b00;\n 2'b10: PHT[train_index] <= train_taken ? 2'b11 : 2'b01;\n 2'b11: PHT[train_index] <= train_taken ? 2'b11 : 2'b10;\n endcase\n end\n \n // Predict\n if (predict_valid) begin\n predict_taken <= (PHT[predict_index] == 2'b10 || PHT[predict_index] == 2'b11);\n predict_history <= global_history;\n end\n end\n end\nendmodule\n", "module top_module(\n input clk,\n input areset, \n\n input predict_valid,\n input [6:0] predict_pc,\n output predict_taken, \n output [6:0] predict_history,\n\n input train_valid,\n input train_taken,\n input train_mispredicted,\n input [6:0] train_history, \n input [6:0] train_pc\n);\n\n // Parameters\n parameter PHT_SIZE = 128;\n parameter BHT_SIZE = 7;\n\n // PHT and BHT\n reg [1:0] PHT [0:PHT_SIZE-1];\n reg [BHT_SIZE-1:0] BHT;\n\n // Index and next state logic\n wire [6:0] index;\n wire [6:0] hashed_pc;\n assign hashed_pc = predict_pc ^ BHT; // XOR based hasher\n assign index = hashed_pc[6:0];\n\n // Prediction\n assign predict_taken = (PHT[index] > 1); // Taken if state > 1\n \n always @(posedge clk or posedge areset) begin\n if (areset) begin\n // Reset PHT and BHT\n integer i;\n for (i = 0; i < PHT_SIZE; i = i + 1) begin\n PHT[i] <= 2'b00; // Initialize to 'Strongly Not Taken'\n end\n BHT <= 7'b0;\n end\n else begin\n // Training\n if (train_valid) begin\n if (train_mispredicted) begin\n BHT <= train_history; // Recover history on misprediction\n end\n // Update PHT on training result\n if (train_taken) begin\n if (PHT[train_pc] < 2'b11) PHT[train_pc] <= PHT[train_pc] + 1; // +1 to state\n end else begin\n if (PHT[train_pc] > 2'b00) PHT[train_pc] <= PHT[train_pc] - 1; // -1 to state\n end\n end\n \n // Prediction update\n if (predict_valid) begin\n // Update BHT based on prediction\n BHT <= (BHT << 1) | predict_taken; // Shift and update BHT\n end\n end\n end\n\n // Output current state of BHT\n assig
{"task_id": "lemmings4", "llmgen_RTL": ["module top_module (\n\tinput clk,\n\tinput areset,\n\tinput bump_left,\n\tinput bump_right,\n\tinput ground,\n\tinput dig,\n\toutput reg walk_left,\n\toutput reg walk_right,\n\toutput reg aaah,\n\toutput reg digging\n);\n \n typedef enum logic [2:0] {\n S_WALK_LEFT,\n S_WALK_RIGHT,\n S_FALL,\n S_DIG,\n S_SPLAT\n } state_t;\n \n state_t current_state, next_state;\n logic [5:0] fall_counter;\n\n always_ff @(posedge clk or posedge areset) begin\n if (areset) begin\n current_state <= S_WALK_LEFT;\n fall_counter <= 6'b0;\n end else begin\n current_state <= next_state;\n if (current_state == S_FALL) begin\n fall_counter <= fall_counter + 1;\n end else begin\n fall_counter <= 6'b0;\n end\n end\n end\n \n always_comb begin\n // Default outputs\n walk_left = 0;\n walk_right = 0;\n aaah = 0;\n digging = 0;\n \n case (current_state)\n S_WALK_LEFT: begin\n walk_left = 1;\n if (!ground) begin\n next_state = S_FALL;\n aaah = 1;\n end else if (dig) begin\n next_state = S_DIG;\n digging = 1;\n end else if (bump_right) begin\n next_state = S_WALK_RIGHT;\n end else if (bump_left) begin\n next_state = S_WALK_LEFT;\n end else begin\n next_state = S_WALK_LEFT;\n end\n end\n \n S_WALK_RIGHT: begin\n walk_right = 1;\n if (!ground) begin\n next_state = S_FALL;\n aaah = 1;\n end else if (dig) begin\n next_state = S_DIG;\n digging = 1;\n end else if (bump_left) begin\n next_state = S_WALK_LEFT;\n end else if (bump_right) begin\n next_state = S_WALK_RIGHT;\n end else begin\n next_state = S_WALK_RIGHT;\n end\n end\n \n S_FALL: begin\n aaah = 1;\n if (ground) begin\n if (fall_counter > 20) begin\n next_state = S_SPLAT;\n end else begin\n next_state = (walk_left ? S_WALK_LEFT : S_WALK_RIGHT);\n end\n end else begin\n next_state = S_FALL;\n end\n end\n \n S_DIG: begin\n digging = 1;\n if (!ground) begin\n next_state = S_FALL;\n aaah = 1;\n end else if (ground) begin\n next_state = (walk_left ? S_WALK_LEFT : S_WALK_RIGHT);\n end else begin\n next_state = S_DIG;\n end\n end\n \n S_SPLAT: begin\n walk_left = 0;\n walk_right = 0;\n aaah = 0;\n digging = 0;\n next_state = S_SPLAT; // Remain in splat state\n end\n \n default: begin\n next_state = S_WALK_LEFT; // default state\n end\n endcase\n end\n \nendmodule\n", "module top_module (\n input clk,\n input areset,\n input bump_left,\n input bump_right,\n input ground,\n input dig,\n output reg walk_left,\n output reg walk_right,\n output reg aaah,\n output reg digging\n);\n\n typedef enum reg [2:0] {\n WALK_LEFT,\n WALK_RIGHT,\n FALLING,\n DIGGING,\n SPLATTER\n } state_t;\n\n state_t current_state, next_state;\n reg [4:0] fall_counter;\n\n always_ff @(posedge clk or posedge areset) begin\n if (areset) begin\n current_state <= WALK_LEFT;\n fall_counter <= 0;\n end else begin\n current_state <= next_state;\n if (current_state == FALLING) begin\n fall_counter <= fall_counter + 1;\n end else begin\n fall_counter <= 0;\n end\n end\n end\n\n always_comb begin\n next_state = current_state;\n walk_left = 0;\n walk_right = 0;\n aaah = 0;\n digging = 0;\n\n case (current_state)\n WALK_LEFT: begin\n walk_left = 1;\n if (!ground) begin\n next_state = FALLING;\n
{"task_id": "review2015_fsm", "llmgen_RTL": ["module top_module(\n\tinput clk,\n\tinput reset,\n\tinput data,\n output reg shift_ena,\n output reg counting,\n input done_counting,\n output reg done,\n input ack );\n\n typedef enum reg [2:0] {\n IDLE,\n PATTERN,\n SHIFT,\n COUNT,\n DONE\n } state_t;\n\n state_t state, next_state;\n reg [3:0] shift_counter;\n\n always @(posedge clk or posedge reset) begin\n if (reset) begin\n state <= IDLE;\n shift_ena <= 0;\n counting <= 0;\n done <= 0;\n shift_counter <= 0;\n end else begin\n state <= next_state;\n if (state == SHIFT) begin\n if (shift_counter < 4) begin\n shift_counter <= shift_counter + 1;\n end else begin\n shift_counter <= 0;\n end\n end else begin\n shift_counter <= 0;\n end\n end\n end\n\n always @(*) begin\n next_state = state;\n shift_ena = 0;\n counting = 0;\n done = 0;\n\n case(state)\n IDLE: begin\n if (data == 1'b1) begin\n next_state = PATTERN;\n end\n end\n PATTERN: begin\n if (data == 1'b1) begin\n next_state = PATTERN;\n end else if (data == 1'b0) begin\n next_state = SHIFT;\n shift_ena = 1;\n end\n end\n SHIFT: begin\n if (shift_counter < 4) begin\n next_state = SHIFT;\n shift_ena = 1;\n end else begin\n next_state = COUNT;\n counting = 1;\n end\n end\n COUNT: begin\n if (done_counting) begin\n next_state = DONE;\n done = 1;\n end else begin\n next_state = COUNT;\n end\n end\n DONE: begin\n if (ack) begin\n next_state = IDLE;\n end else begin\n next_state = DONE;\n end\n end\n endcase\n end\n\nendmodule\n", "module top_module(\n input clk,\n input reset,\n input data,\n output reg shift_ena,\n output reg counting,\n input done_counting,\n output reg done,\n input ack\n);\n\n typedef enum reg [2:0] {\n IDLE,\n WAIT_PATTERN,\n SHIFT,\n COUNT,\n DONE\n } state_t;\n\n state_t current_state, next_state;\n reg [3:0] bit_count;\n\n always @(posedge clk or posedge reset) begin\n if (reset) begin\n current_state <= IDLE;\n shift_ena <= 0;\n counting <= 0;\n done <= 0;\n bit_count <= 0;\n end else begin\n current_state <= next_state;\n end\n end\n\n always @(*) begin\n next_state = current_state;\n shift_ena = 0;\n counting = 0;\n done = 0;\n\n case (current_state)\n IDLE: begin\n if (data == 1'b1) begin\n next_state = WAIT_PATTERN;\n end\n end\n\n WAIT_PATTERN: begin\n if (data == 3'b110) begin\n if (bit_count == 3) begin\n next_state = SHIFT;\n bit_count = 0;\n end else begin\n bit_count = bit_count + 1;\n end\n end else begin\n next_state = IDLE;\n end\n end\n\n SHIFT: begin\n shift_ena = 1;\n if (bit_count < 4) begin\n bit_count = bit_count + 1;\n end else begin\n next_state = COUNT;\n bit
{"task_id": "conwaylife", "llmgen_RTL": ["module top_module(\n input clk,\n input load,\n input [255:0] data,\n output reg [255:0] q\n);\n reg [7:0] count;\n wire [255:0] next_q;\n\n // Calculate next state based on current state q\n function [2:0] count_neighbors(input [255:0] state, input [3:0] row, input [3:0] col);\n integer i, j;\n begin\n count_neighbors = 0;\n for (i = -1; i <= 1; i = i + 1) begin\n for (j = -1; j <= 1; j = j + 1) begin\n if ((i != 0 || j != 0)) begin\n count_neighbors = count_neighbors + state[((row + i + 16) % 16) * 16 + ((col + j + 16) % 16)];\n end\n end\n end\n end\n endfunction\n\n // Generate next state of the grid\n generate\n genvar r, c;\n for (r = 0; r < 16; r = r + 1) begin : row\n for (c = 0; c < 16; c = c + 1) begin : col\n always @(*) begin\n case (count_neighbors(q, r, c))\n 1: next_q[r * 16 + c] = 0; // 0-1 neighbors\n 2: next_q[r * 16 + c] = q[r * 16 + c]; // 2 neighbors\n 3: next_q[r * 16 + c] = 1; // 3 neighbors\n default: next_q[r * 16 + c] = 0; // 4+ neighbors\n endcase\n end\n end\n end\n endgenerate\n\n // Synchronous load and state update\n always @(posedge clk) begin\n if (load) begin\n q <= data;\n end else begin\n q <= next_q;\n end\n end\nendmodule\n", "module top_module(\n input clk,\n input load,\n input [255:0] data,\n output reg [255:0] q\n);\n \n reg [255:0] next_q;\n \n always @(posedge clk) begin\n if (load)\n q <= data;\n else\n q <= next_q;\n end\n\n always @* begin\n integer i, j, count;\n next_q = q; // Default to the current state\n\n for (i = 0; i < 16; i = i + 1) begin\n for (j = 0; j < 16; j = j + 1) begin\n count = 0;\n\n // Check all 8 neighbours\n for (integer di = -1; di <= 1; di = di + 1) begin\n for (integer dj = -1; dj <= 1; dj = dj + 1) begin\n if (di == 0 && dj == 0) continue; // Skip the cell itself\n count = count + q[((i + di + 16) % 16) * 16 + ((j + dj + 16) % 16)];\n end\n end\n\n // Apply the rules\n case (count)\n 0, 1, 4: next_q[i * 16 + j] = 0;\n 2: next_q[i * 16 + j] = q[i * 16 + j]; // No change\n 3: next_q[i * 16 + j] = 1;\n default: next_q[i * 16 + j] = 0;\n endcase\n end\n end\n end\nendmodule\n", "module top_module(\n input clk,\n input load,\n input [255:0] data,\n output reg [255:0] q\n);\n reg [255:0] next_q;\n\n always @(posedge clk) begin\n if (load) begin\n q <= data;\n end else begin\n q <= next_q;\n end\n end\n\n integer i, j, alive_neighbors;\n\n always @(*) begin\n next_q = q;\n for (i = 0; i < 16; i = i + 1) begin\n for (j = 0; j < 16; j = j + 1) begin\n alive_neighbors = 0;\n // Count alive neighbors\n for (integer di = -1; di <= 1; di = di + 1) begin\n for (integer dj = -1; dj <= 1; dj = dj + 1) begin\n if (di == 0 && dj == 0) continue; // Skip the cell itself\n alive_neighbors = alive_neighbors + q[(i + di + 16) % 16 * 16 + (j + dj + 16) % 16];\n end\n end\n\n // Update next state based on rules\n case (q[i * 16 + j])\n 1'b0: begin\n if (alive_neighbors == 3) next_q[i * 16 + j] = 1'b1;\n
{"task_id": "lemmings3", "llmgen_RTL": ["module top_module (\n input clk,\n input areset,\n input bump_left,\n input bump_right,\n input ground,\n input dig,\n output reg walk_left,\n output reg walk_right,\n output reg aaah,\n output reg digging\n);\n\n typedef enum reg [2:0] {\n STATE_WALK_LEFT,\n STATE_WALK_RIGHT,\n STATE_FALL,\n STATE_DIG\n } state_t;\n\n state_t current_state, next_state;\n\n always @(posedge clk or posedge areset) begin\n if (areset) begin\n current_state <= STATE_WALK_LEFT;\n end else begin\n current_state <= next_state;\n end\n end\n\n always @* begin\n // Default outputs\n walk_left = 0;\n walk_right = 0;\n aaah = 0;\n digging = 0;\n \n case (current_state)\n STATE_WALK_LEFT: begin\n walk_left = 1;\n if (!ground) begin\n next_state = STATE_FALL;\n aaah = 1;\n end else if (dig) begin\n next_state = STATE_DIG;\n digging = 1;\n end else if (bump_right) begin\n next_state = STATE_WALK_RIGHT;\n end else begin\n next_state = STATE_WALK_LEFT;\n end\n end\n \n STATE_WALK_RIGHT: begin\n walk_right = 1;\n if (!ground) begin\n next_state = STATE_FALL;\n aaah = 1;\n end else if (dig) begin\n next_state = STATE_DIG;\n digging = 1;\n end else if (bump_left) begin\n next_state = STATE_WALK_LEFT;\n end else begin\n next_state = STATE_WALK_RIGHT;\n end\n end\n \n STATE_FALL: begin\n aaah = 1;\n if (ground) begin\n if (bump_left) begin\n next_state = STATE_WALK_RIGHT;\n end else if (bump_right) begin\n next_state = STATE_WALK_LEFT;\n end else begin\n if (walk_left) begin\n next_state = STATE_WALK_LEFT;\n end else begin\n next_state = STATE_WALK_RIGHT;\n end\n end\n end else begin\n next_state = STATE_FALL;\n end\n end\n \n STATE_DIG: begin\n digging = 1;\n if (!ground) begin\n next_state = STATE_FALL;\n aaah = 1;\n end else begin\n next_state = STATE_DIG;\n end\n end\n \n default: next_state = STATE_WALK_LEFT;\n endcase\n end\n\nendmodule\n", "module top_module (\n input clk,\n input areset,\n input bump_left,\n input bump_right,\n input ground,\n input dig,\n output reg walk_left,\n output reg walk_right,\n output reg aaah,\n output reg digging\n);\n\n typedef enum reg [2:0] {\n WALK_LEFT,\n WALK_RIGHT,\n FALLING,\n DIGGING,\n WAIT_FOR_GROUND\n } state_t;\n\n state_t current_state, next_state;\n\n always_ff @(posedge clk or posedge areset) begin\n if (areset) \n current_state <= WALK_LEFT;\n else \n current_state <= next_state;\n end\n\n always_ff @(current_state or bump_left or bump_right or ground or dig) begin\n // Default outputs\n walk_left = 0;\n walk_right = 0;\n aaah = 0;\n digging = 0;\n next_state = current_state;\n\n case (current_state)\n WALK_LEFT: begin\n walk_left = 1;\n if (!ground) begin\n next_state = FALLING;\n
{"task_id": "count_clock", "llmgen_RTL": ["module top_module(\n input clk,\n input reset,\n input ena,\n output reg pm,\n output reg [7:0] hh,\n output reg [7:0] mm,\n output reg [7:0] ss\n);\n \n always @(posedge clk) begin\n if (reset) begin\n hh <= 8'b0001_0010; // 12:00 AM in BCD\n mm <= 8'b0000_0000; // 00 minutes\n ss <= 8'b0000_0000; // 00 seconds\n pm <= 1'b0; // AM\n end else if (ena) begin\n if (ss == 8'b0101_1001) begin // 59 seconds\n ss <= 8'b0000_0000; // reset seconds\n if (mm == 8'b0101_1001) begin // 59 minutes\n mm <= 8'b0000_0000; // reset minutes\n if (hh == 8'b0001_0010) begin // 12 hours\n hh <= 8'b0001_0001; // reset to 1 hour\n pm <= ~pm; // toggle AM/PM\n end else if (hh == 8'b0001_0001) begin // 1 hour\n hh <= 8'b0001_0010; // set to 2 hours\n end else if (hh == 8'b0001_0010) begin // 2 hours\n hh <= 8'b0001_0011; // set to 3 hours\n end else if (hh == 8'b0001_0011) begin // 3 hours\n hh <= 8'b0001_0100; // set to 4 hours\n end else if (hh == 8'b0001_0100) begin // 4 hours\n hh <= 8'b0001_0101; // set to 5 hours\n end else if (hh == 8'b0001_0101) begin // 5 hours\n hh <= 8'b0001_0110; // set to 6 hours\n end else if (hh == 8'b0001_0110) begin // 6 hours\n hh <= 8'b0001_0111; // set to 7 hours\n end else if (hh == 8'b0001_0111) begin // 7 hours\n hh <= 8'b0001_1000; // set to 8 hours\n end else if (hh == 8'b0001_1000) begin // 8 hours\n hh <= 8'b0001_1001; // set to 9 hours\n end else if (hh == 8'b0001_1001) begin // 9 hours\n hh <= 8'b0001_1010; // set to 10 hours\n end else if (hh == 8'b0001_1010) begin // 10 hours\n hh <= 8'b0001_1011; // set to 11 hours\n end else if (hh == 8'b0001_1011) begin // 11 hours\n hh <= 8'b0001_1100; // set to 12 hours\n end \n end else begin\n mm <= mm + 1; // increment minutes\n end\n end else begin\n ss <= ss + 1; // increment seconds\n end\n end\n end\n\nendmodule\n", "module top_module(\n input clk,\n input reset,\n input ena,\n output reg pm,\n output reg [7:0] hh,\n output reg [7:0] mm,\n output reg [7:0] ss\n);\n\n // Initialize the clock\n initial begin\n hh = 8'b00001100; // Initial hour: 12\n mm = 8'b00000000; // Initial minutes: 00\n ss = 8'b00000000; // Initial seconds: 00\n pm = 1'b0; // Initial state: AM\n end\n\n always @(posedge clk) begin\n if (reset) begin\n hh <= 8'b00001100; // Reset to 12\n mm <= 8'b00000000; // Reset to 00\n ss <= 8'b00000000; // Reset to 00\n pm <= 1'b0; // Reset to AM\n end else if (ena) begin\n // Increment seconds\n if (ss == 8'b00111001) begin // 59 in decimal\n ss <= 8'b00000000; // Reset seconds\n // Increment minutes\n if (mm == 8'b00111001) begin // 59 in decimal\n mm <= 8'b00000000; // Reset minutes\n // Increment hours\n if (hh == 8'b00001100) begin // 12 in decimal\n hh <= 8'b00000001; // Set to 1\n pm <= ~pm; // Toggle AM/PM\n end else if (hh == 8'b00000001 && pm == 1'b1) begin // Transition from 1 PM to 2 PM\n hh <= 8'b00000010; // Set to 2\n end else if (hh < 8'b00001100) be
{"task_id": "lemmings2", "llmgen_RTL": ["module top_module (\n input clk,\n input areset,\n input bump_left,\n input bump_right,\n input ground,\n output reg walk_left,\n output reg walk_right,\n output reg aaah\n);\n\n typedef enum reg [1:0] {WALK_LEFT, WALK_RIGHT, FALL} state_t;\n state_t current_state, next_state;\n\n always_ff @(posedge clk or posedge areset) begin\n if (areset) begin\n current_state <= WALK_LEFT;\n end else begin\n current_state <= next_state;\n end\n end\n\n always_ff @(current_state, bump_left, bump_right, ground) begin\n walk_left = 0;\n walk_right = 0;\n aaah = 0;\n case (current_state)\n WALK_LEFT: begin\n if (!ground) begin\n next_state = FALL;\n aaah = 1;\n end else if (bump_right) begin\n next_state = WALK_RIGHT;\n end else begin\n next_state = WALK_LEFT;\n walk_left = 1;\n end\n end\n WALK_RIGHT: begin\n if (!ground) begin\n next_state = FALL;\n aaah = 1;\n end else if (bump_left) begin\n next_state = WALK_LEFT;\n end else begin\n next_state = WALK_RIGHT;\n walk_right = 1;\n end\n end\n FALL: begin\n if (ground) begin\n next_state = (bump_left) ? WALK_RIGHT : (bump_right) ? WALK_LEFT : current_state;\n end else begin\n next_state = FALL;\n aaah = 1;\n end\n end\n endcase\n end\nendmodule\n", "module top_module (\n input clk,\n input areset,\n input bump_left,\n input bump_right,\n input ground,\n output reg walk_left,\n output reg walk_right,\n output reg aaah\n);\n\n typedef enum logic [1:0] {\n WALK_LEFT,\n WALK_RIGHT,\n FALL\n } state_t;\n\n state_t state, next_state;\n\n always_ff @(posedge clk or posedge areset) begin\n if (areset) begin\n state <= WALK_LEFT;\n end else begin\n state <= next_state;\n end\n end\n\n always_ff @(state, bump_left, bump_right, ground) begin\n walk_left = 0;\n walk_right = 0;\n aaah = 0;\n next_state = state;\n\n case (state)\n WALK_LEFT: begin\n if (!ground) begin\n next_state = FALL;\n aaah = 1;\n end else if (bump_right) begin\n next_state = WALK_RIGHT;\n end\n walk_left = 1;\n end\n\n WALK_RIGHT: begin\n if (!ground) begin\n next_state = FALL;\n aaah = 1;\n end else if (bump_left) begin\n next_state = WALK_LEFT;\n end\n walk_right = 1;\n end\n\n FALL: begin\n if (ground) begin\n next_state = (walk_left) ? WALK_LEFT : WALK_RIGHT;\n end\n end\n endcase\n end\n\nendmodule\n", "module top_module (\n input clk,\n input areset,\n input bump_left,\n input bump_right,\n input ground,\n output reg walk_left,\n output reg walk_right,\n output reg aaah\n);\n\n typedef enum logic [1:0] {\n LEFT_WALK = 2'b00,\n RIGHT_WALK = 2'b01,\n FALL = 2'b10\n } state_t;\n\n state_t current_state, next_state;\n\n always_ff @(posedge clk or posedge areset) begin\n if (areset) begin\n current_state <= LEFT_WALK;\n end else begin\n current_state <= next_state;\n end\n end\n\n always_ff @(current_state, bump_left, bump_right, ground) begin\n aaah = 0;\n walk_left = 0;\n walk_right
{"task_id": "countbcd", "llmgen_RTL": ["module top_module(\n input clk,\n input reset,\n output [3:1] ena,\n output reg [15:0] q\n);\n reg [3:0] ones, tens, hundreds, thousands;\n\n assign ena[1] = (ones == 4'd9) && (tens < 4'd9);\n assign ena[2] = (tens == 4'd9) && (hundreds < 4'd9);\n assign ena[3] = (hundreds == 4'd9) && (thousands < 4'd9);\n\n always @(posedge clk or posedge reset) begin\n if (reset) begin\n ones <= 4'd0;\n tens <= 4'd0;\n hundreds <= 4'd0;\n thousands <= 4'd0;\n end else begin\n if (ones == 4'd9) begin\n ones <= 4'd0;\n if (tens == 4'd9) begin\n tens <= 4'd0;\n if (hundreds == 4'd9) begin\n hundreds <= 4'd0;\n thousands <= (thousands == 4'd9) ? 4'd0 : thousands + 4'd1;\n end else begin\n hundreds <= hundreds + 4'd1;\n end\n end else begin\n tens <= tens + 4'd1;\n end\n end else begin\n ones <= ones + 4'd1;\n end\n end\n end\n\n always @* begin\n q = {thousands, hundreds, tens, ones};\n end\nendmodule\n", "module top_module(\n\tinput clk,\n\tinput reset,\n\toutput [3:1] ena,\n\toutput reg [15:0] q);\n\n\talways @(posedge clk or posedge reset) begin\n\t\tif (reset) begin\n\t\t\tq <= 16'b0;\n\t\tend else begin\n\t\t\tif (q[3:0] == 4'd9) begin\n\t\t\t\tq[3:0] <= 4'b0;\n\t\t\t\tif (q[7:4] == 4'd9) begin\n\t\t\t\t\tq[7:4] <= 4'b0;\n\t\t\t\t\tif (q[11:8] == 4'd9) begin\n\t\t\t\t\t\tq[11:8] <= 4'b0;\n\t\t\t\t\t\tif (q[15:12] < 4'd9) begin\n\t\t\t\t\t\t\tq[15:12] <= q[15:12] + 1;\n\t\t\t\t\t\tend\n\t\t\t\t\tend else begin\n\t\t\t\t\t\tq[11:8] <= q[11:8] + 1;\n\t\t\t\t\tend\n\t\t\t\t\tena[3] <= 1; // enable for hundreds\n\t\t\t\tend else begin\n\t\t\t\t\tq[7:4] <= q[7:4] + 1;\n\t\t\t\tend\n\t\t\t\tena[2] <= 1; // enable for tens\n\t\t\tend else begin\n\t\t\t\tq[3:0] <= q[3:0] + 1;\n\t\t\tend\n\t\t\tena[1] <= 1; // enable for ones\n\t\tend\n\tend\nendmodule\n", "module top_module(\n input clk,\n input reset,\n output [3:1] ena,\n output reg [15:0] q\n);\n\n reg [3:0] ones, tens, hundreds, thousands;\n\n always @(posedge clk or posedge reset) begin\n if (reset) begin\n ones <= 4'b0000;\n tens <= 4'b0000;\n hundreds <= 4'b0000;\n thousands <= 4'b0000;\n end else begin\n if (ones == 4'b1001) begin\n ones <= 4'b0000;\n if (tens == 4'b1001) begin\n tens <= 4'b0000;\n if (hundreds == 4'b1001) begin\n hundreds <= 4'b0000;\n if (thousands == 4'b1001) begin\n thousands <= 4'b0000;\n end else begin\n thousands <= thousands + 1;\n end\n end else begin\n hundreds <= hundreds + 1;\n end\n end else begin\n tens <= tens + 1;\n end\n end else begin\n ones <= ones + 1;\n end\n end\n end\n\n always @* begin\n q = {thousands, hundreds, tens, ones};\n ena[1] = (ones == 4'b1001);\n ena[2] = (tens == 4'b1001 && ones == 4'b1001);\n ena[3] = (hundreds == 4'b1001 && tens == 4'b1001 && ones == 4'b1001);\n end\n\nendmodule\n", "module top_module(\n input clk,\n input reset,\n output [3:1] ena,\n output reg [15:0] q\n);\n \n always @(posedge clk or posedge reset) begin\n if (reset) begin\n q <= 0;\n end else begin\n if (q[3:0] == 9) begin\n q[3:0] <= 0;\n ena[1] <= 1;\n if (q[7:4] == 9) begin\n q[7:4] <= 0;\n ena[2] <= 1;\n if (