This repository contains a Python script that automates the generation of Verilog files for hardware design. The script allows users to define module headers, input and output ports, internal wires, parameters, and logic for both combinational and sequential circuits. It also generates corresponding testbench files for simulation.
- Module Header Creation: Define the module name, input ports, output ports, and internal wires.
- Parameter Management: Specify parameters to be included in the Verilog file.
- Logic Generation: Automatically generates combinational and sequential logic structures based on user input.
- Testbench Creation: Generates a testbench for the designed module, including clock generation and initial conditions.
create_module_header_ports_strings(module_name, input_ports, output_ports, internal_wires): Creates the module header and port declarations.create_paramters_strings(parameters): Converts parameter specifications into a Verilog-compatible format.create_my_logic_comb_strings(comb_logic_dict): Generates combinational logic based on provided conditions.create_my_logic_seq_strings(seq_logic_dict): Generates sequential logic based on clock and reset conditions.create_logic_strings(my_logic): Combines the logic strings for both combinational and sequential logic.create_my_main_file(module_name_input, my_ports_wires_header, parameters, my_logic, path): Writes the main Verilog file with the specified components.create_test_bnech_file(module_name_input, my_ports_wires_header, parameters, clk_name, my_test_bench_info, path): Generates a testbench file for simulation.run(): The main function that executes the script, collects user inputs, and generates the Verilog and testbench files.
To use the script:
- Run the script to start the interactive command-line interface.
- Follow the prompts to enter the module name, parameters, input and output ports, and internal wires.
- Specify the logic for the module, including both combinational and sequential logic.
- The script will generate the Verilog files and testbench files in the specified directory.