data/full_repos/permissive/209997170/Sound/sound_ref/source/mojo_top.v
1: b"%Error: data/full_repos/permissive/209997170/Sound/sound_ref/source/mojo_top.v:76: Cannot find file containing module: 'pwm'\npwm pwm0 (\n^~~\n        ... Looked in:\n             data/full_repos/permissive/209997170/Sound/sound_ref/source,data/full_repos/permissive/209997170/pwm\n             data/full_repos/permissive/209997170/Sound/sound_ref/source,data/full_repos/permissive/209997170/pwm.v\n             data/full_repos/permissive/209997170/Sound/sound_ref/source,data/full_repos/permissive/209997170/pwm.sv\n             pwm\n             pwm.v\n             pwm.sv\n             obj_dir/pwm\n             obj_dir/pwm.v\n             obj_dir/pwm.sv\n%Error: data/full_repos/permissive/209997170/Sound/sound_ref/source/mojo_top.v:84: Cannot find file containing module: 'pwm'\npwm pwm1 (\n^~~\n%Error: data/full_repos/permissive/209997170/Sound/sound_ref/source/mojo_top.v:92: Cannot find file containing module: 'pwm'\npwm pwm2 (\n^~~\n%Error: data/full_repos/permissive/209997170/Sound/sound_ref/source/mojo_top.v:100: Cannot find file containing module: 'pwm'\npwm pwm3 (\n^~~\n%Error: data/full_repos/permissive/209997170/Sound/sound_ref/source/mojo_top.v:130: Cannot find file containing module: 'avr_interface'\navr_interface avr_interface (\n^~~~~~~~~~~~~\n%Error: data/full_repos/permissive/209997170/Sound/sound_ref/source/mojo_top.v:154: Cannot find file containing module: 'analog_input'\nanalog_input analog_input (\n^~~~~~~~~~~~\n%Error: data/full_repos/permissive/209997170/Sound/sound_ref/source/mojo_top.v:166: Cannot find file containing module: 'pwm'\npwm led_pwm (  \n^~~\n%Error: Exiting due to 7 error(s)\n"
module mojo_top(

    input  clk,

    input  rst_n,

    input  cclk,

    output [7:0] led,

    output spi_miso,
    input  spi_ss,
    input  spi_mosi,
    input  spi_sck,

    output [3:0] spi_channel,

    input  avr_tx,
    output avr_rx,
    input  avr_rx_busy,
  output [7:0] dac,
  input  [4:0] button 
    );

wire rst = ~rst_n;

wire [3:0] gen;


assign spi_miso = 1'bz;
assign avr_rx = 1'bz;
assign spi_channel = 4'bzzzz;


wire [3:0] channel;
wire new_sample;
wire [9:0] sample;
wire [3:0] sample_channel;
wire [7:0] adc_wire;

wire [24-1:0] m_period;

assign m_period = (1 << 8) * adc_wire;







localparam a0 = 16;
localparam a1 = 32;
localparam a2 = 64;
localparam a3 = 128;







assign dac[7:0] = (gen[0] & button[0] ? a0 : 0) +
  (gen[1] & button[1] ? a1 : 0) +
  (gen[2] & button[2] ? a2 : 0) +
  (gen[3] & button[3] ? a3 : 0);





localparam p0 = 1 << 12;
localparam p1 = 1 << 14;
localparam p2 = 1 << 16;
localparam p3 = 1 << 18;

pwm pwm0 (
  .clk(clk),
  .rst(rst),
  .period(p0),
  .compare(p0/2),
  .pwm(gen[0])
  );

pwm pwm1 (
  .rst(rst),
  .clk(clk),
  .period(p1),
  .compare(p1/2),
  .pwm(gen[1])
  );

pwm pwm2 (
  .rst(rst),
  .clk(clk),
  .period(p2),
  .compare(p2/2),
  .pwm(gen[2])
  );

pwm pwm3 (
  .rst(rst),
  .clk(clk),
  .period(m_period),
  .compare(m_period/2),
  .pwm(gen[3])
  );























avr_interface avr_interface (
    .clk(clk),
    .rst(rst),
    .cclk(cclk),
    .spi_miso(spi_miso),
    .spi_mosi(spi_mosi),
    .spi_sck(spi_sck),
    .spi_ss(spi_ss),
    .spi_channel(spi_channel),
    .tx(avr_rx),
    .rx(avr_tx),
    .channel(channel),
    .new_sample(new_sample),
    .sample(sample),
    .sample_channel(sample_channel),
    .tx_data(8'h00),
    .new_tx_data(1'b0),
    .tx_busy(),
    .tx_block(avr_rx_busy),
    .rx_data(),
    .new_rx_data()
);


analog_input analog_input (
    .clk(clk),
    .rst(rst),
    .channel(channel),
    .new_sample(new_sample),
    .sample(sample),
    .sample_channel(sample_channel),
    .out(adc_wire) 
);

wire led_pwm_wire;
assign led = {8{led_pwm_wire}};
pwm led_pwm (
    .clk(clk),
    .rst(rst),
	 .period({10{1'b1}}),
    .compare(adc_wire),
    .pwm(led_pwm_wire)
);


endmodule
module mojo_top(

    input  clk,

    input  rst_n,

    input  cclk,

    output [7:0] led,

    output spi_miso,
    input  spi_ss,
    input  spi_mosi,
    input  spi_sck,

    output [3:0] spi_channel,

    input  avr_tx,
    output avr_rx,
    input  avr_rx_busy,
  output [7:0] dac,
  input  [4:0] button 
    );


wire rst = ~rst_n;

wire [3:0] gen;


assign spi_miso = 1'bz;
assign avr_rx = 1'bz;
assign spi_channel = 4'bzzzz;


wire [3:0] channel;
wire new_sample;
wire [9:0] sample;
wire [3:0] sample_channel;
wire [7:0] adc_wire;

wire [24-1:0] m_period;

assign m_period = (1 << 8) * adc_wire;







localparam a0 = 16;
localparam a1 = 32;
localparam a2 = 64;
localparam a3 = 128;







assign dac[7:0] = (gen[0] & button[0] ? a0 : 0) +
  (gen[1] & button[1] ? a1 : 0) +
  (gen[2] & button[2] ? a2 : 0) +
  (gen[3] & button[3] ? a3 : 0);





localparam p0 = 1 << 12;
localparam p1 = 1 << 14;
localparam p2 = 1 << 16;
localparam p3 = 1 << 18;

pwm pwm0 (
  .clk(clk),
  .rst(rst),
  .period(p0),
  .compare(p0/2),
  .pwm(gen[0])
  );

pwm pwm1 (
  .rst(rst),
  .clk(clk),
  .period(p1),
  .compare(p1/2),
  .pwm(gen[1])
  );

pwm pwm2 (
  .rst(rst),
  .clk(clk),
  .period(p2),
  .compare(p2/2),
  .pwm(gen[2])
  );

pwm pwm3 (
  .rst(rst),
  .clk(clk),
  .period(m_period),
  .compare(m_period/2),
  .pwm(gen[3])
  );























avr_interface avr_interface (
    .clk(clk),
    .rst(rst),
    .cclk(cclk),
    .spi_miso(spi_miso),
    .spi_mosi(spi_mosi),
    .spi_sck(spi_sck),
    .spi_ss(spi_ss),
    .spi_channel(spi_channel),
    .tx(avr_rx),
    .rx(avr_tx),
    .channel(channel),
    .new_sample(new_sample),
    .sample(sample),
    .sample_channel(sample_channel),
    .tx_data(8'h00),
    .new_tx_data(1'b0),
    .tx_busy(),
    .tx_block(avr_rx_busy),
    .rx_data(),
    .new_rx_data()
);


analog_input analog_input (
    .clk(clk),
    .rst(rst),
    .channel(channel),
    .new_sample(new_sample),
    .sample(sample),
    .sample_channel(sample_channel),
    .out(adc_wire) 
);

wire led_pwm_wire;
assign led = {8{led_pwm_wire}};
pwm led_pwm (
    .clk(clk),
    .rst(rst),
	 .period({10{1'b1}}),
    .compare(adc_wire),
    .pwm(led_pwm_wire)
);


endmodule