data/full_repos/permissive/169373084/RomReader/src/rom_reader_programmer.v
1: b'%Warning-WIDTH: data/full_repos/permissive/169373084/RomReader/src/rom_reader_programmer.v:65: Operator COND expects 9 bits on the Conditional False, but Conditional False\'s VARREF \'ip3601_address_port\' generates 8 bits.\n                                                                                             : ... In instance rom_reader_programmer\nassign chip_address_port = chip_selection_button == 1 ? ip3604_address_port : ip3601_address_port;\n                                                      ^\n                ... Use "/* verilator lint_off WIDTH */" and lint_on around source to disable this message.\n%Warning-WIDTH: data/full_repos/permissive/169373084/RomReader/src/rom_reader_programmer.v:66: Operator COND expects 8 bits on the Conditional False, but Conditional False\'s VARREF \'ip3601_output_port\' generates 4 bits.\n                                                                                             : ... In instance rom_reader_programmer\nassign data_output_port = chip_selection_button == 1 ? ip3604_output_port : ip3601_output_port;\n                                                     ^\n%Error: data/full_repos/permissive/169373084/RomReader/src/rom_reader_programmer.v:74: Cannot find file containing module: \'debouncer\'\ndebouncer #(.DEBOUNCE_VALUE(100000))\n^~~~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/169373084/RomReader/src,data/full_repos/permissive/169373084/debouncer\n             data/full_repos/permissive/169373084/RomReader/src,data/full_repos/permissive/169373084/debouncer.v\n             data/full_repos/permissive/169373084/RomReader/src,data/full_repos/permissive/169373084/debouncer.sv\n             debouncer\n             debouncer.v\n             debouncer.sv\n             obj_dir/debouncer\n             obj_dir/debouncer.v\n             obj_dir/debouncer.sv\n%Error: data/full_repos/permissive/169373084/RomReader/src/rom_reader_programmer.v:76: Cannot find file containing module: \'debouncer\'\ndebouncer #(.DEBOUNCE_VALUE(100000))\n^~~~~~~~~\n%Error: data/full_repos/permissive/169373084/RomReader/src/rom_reader_programmer.v:79: Cannot find file containing module: \'rom_reader\'\nrom_reader #(.DATA_WIDTH(8), .ADDRESS_WIDTH(9), .CHIP(1)) \n^~~~~~~~~~\n%Error: data/full_repos/permissive/169373084/RomReader/src/rom_reader_programmer.v:88: Cannot find file containing module: \'rom_reader\'\nrom_reader #(.DATA_WIDTH(4), .ADDRESS_WIDTH(8), .CHIP(2)) \n^~~~~~~~~~\n%Error: data/full_repos/permissive/169373084/RomReader/src/rom_reader_programmer.v:98: Cannot find file containing module: \'address_display\'\naddress_display ssegment_tube(.address_line(chip_address_port), .clk(clk), .reset(reset_button), \n^~~~~~~~~~~~~~~\n%Error: Exiting due to 5 error(s), 2 warning(s)\n'
module rom_reader_programmer(
    input wire chip_selection_button,
    input wire increment_address_button,
    input wire decrement_address_button,
    input wire reset_button,
    input wire clk,
    input wire [7:0] chip_data_port,
    output wire [8:0] chip_address_port,
    output wire [3:0] ip3604_selection_port,
    output wire [1:0] ip3601_selection_port,
    output wire [7:0] data_output_port,
    output wire [7:0] sseg_tube_port,
    output wire [3:0] sseg_selected_digit,
    output wire ip3601_selection_led,
    output wire ip3604_selection_led
);

wire [7:0] ip3601_address_port;
wire [3:0] ip3601_output_port;

wire [8:0] ip3604_address_port;
wire [7:0] ip3604_output_port;


wire ip3604_reset;
wire ip3601_reset;

wire increment_debounced;
wire decrement_debounced;

assign chip_address_port = chip_selection_button == 1 ? ip3604_address_port : ip3601_address_port;
assign data_output_port = chip_selection_button == 1 ? ip3604_output_port : ip3601_output_port;

assign ip3601_selection_led = chip_selection_button == 0 ? 1'b1: 1'b0;
assign ip3604_selection_led = chip_selection_button == 1 ? 1'b1: 1'b0;

assign ip3604_reset = reset_button & ip3604_selection_led;
assign ip3601_reset = reset_button & ip3601_selection_led;

debouncer #(.DEBOUNCE_VALUE(100000))
    inc_debouncer(.clk(clk), .reset(reset_button), .line(increment_address_button), .debounced_line(increment_debounced));
debouncer #(.DEBOUNCE_VALUE(100000))
    dec_debouncer(.clk(clk), .reset(reset_button), .line(decrement_address_button), .debounced_line(decrement_debounced));

rom_reader #(.DATA_WIDTH(8), .ADDRESS_WIDTH(9), .CHIP(1)) 
    ip3604_reader(.clk(clk), .reset_n(ip3604_reset), 
                  .increment_address(~increment_debounced),
                  .decrement_address(~decrement_debounced),
                  .data_line_in(chip_data_port),
                  .operation(ip3604_selection_port),
                  .address_line(ip3604_address_port),
                  .data_line(ip3604_output_port));

rom_reader #(.DATA_WIDTH(4), .ADDRESS_WIDTH(8), .CHIP(2)) 
    ip3601_reader(.clk(clk), .reset_n(ip3601_reset), 
                  .increment_address(~increment_debounced),
                  .decrement_address(~decrement_debounced),
                  .data_line_in(chip_data_port[3:0]),
                  .operation(ip3601_selection_port),
                  .address_line(ip3601_address_port),
                  .data_line(ip3601_output_port));


address_display ssegment_tube(.address_line(chip_address_port), .clk(clk), .reset(reset_button), 
                              .sseg_indicator(sseg_tube_port), .digits(sseg_selected_digit));

endmodule
module rom_reader_programmer(
    input wire chip_selection_button,
    input wire increment_address_button,
    input wire decrement_address_button,
    input wire reset_button,
    input wire clk,
    input wire [7:0] chip_data_port,
    output wire [8:0] chip_address_port,
    output wire [3:0] ip3604_selection_port,
    output wire [1:0] ip3601_selection_port,
    output wire [7:0] data_output_port,
    output wire [7:0] sseg_tube_port,
    output wire [3:0] sseg_selected_digit,
    output wire ip3601_selection_led,
    output wire ip3604_selection_led
);


wire [7:0] ip3601_address_port;
wire [3:0] ip3601_output_port;

wire [8:0] ip3604_address_port;
wire [7:0] ip3604_output_port;


wire ip3604_reset;
wire ip3601_reset;

wire increment_debounced;
wire decrement_debounced;

assign chip_address_port = chip_selection_button == 1 ? ip3604_address_port : ip3601_address_port;
assign data_output_port = chip_selection_button == 1 ? ip3604_output_port : ip3601_output_port;

assign ip3601_selection_led = chip_selection_button == 0 ? 1'b1: 1'b0;
assign ip3604_selection_led = chip_selection_button == 1 ? 1'b1: 1'b0;

assign ip3604_reset = reset_button & ip3604_selection_led;
assign ip3601_reset = reset_button & ip3601_selection_led;

debouncer #(.DEBOUNCE_VALUE(100000))
    inc_debouncer(.clk(clk), .reset(reset_button), .line(increment_address_button), .debounced_line(increment_debounced));
debouncer #(.DEBOUNCE_VALUE(100000))
    dec_debouncer(.clk(clk), .reset(reset_button), .line(decrement_address_button), .debounced_line(decrement_debounced));

rom_reader #(.DATA_WIDTH(8), .ADDRESS_WIDTH(9), .CHIP(1)) 
    ip3604_reader(.clk(clk), .reset_n(ip3604_reset), 
                  .increment_address(~increment_debounced),
                  .decrement_address(~decrement_debounced),
                  .data_line_in(chip_data_port),
                  .operation(ip3604_selection_port),
                  .address_line(ip3604_address_port),
                  .data_line(ip3604_output_port));

rom_reader #(.DATA_WIDTH(4), .ADDRESS_WIDTH(8), .CHIP(2)) 
    ip3601_reader(.clk(clk), .reset_n(ip3601_reset), 
                  .increment_address(~increment_debounced),
                  .decrement_address(~decrement_debounced),
                  .data_line_in(chip_data_port[3:0]),
                  .operation(ip3601_selection_port),
                  .address_line(ip3601_address_port),
                  .data_line(ip3601_output_port));


address_display ssegment_tube(.address_line(chip_address_port), .clk(clk), .reset(reset_button), 
                              .sseg_indicator(sseg_tube_port), .digits(sseg_selected_digit));

endmodule