data/full_repos/permissive/129527056/cores/trojan/hdl/jttrojan_sound.v
 line:70: before: "re"
1: b"%Error: data/full_repos/permissive/129527056/cores/trojan/hdl/jttrojan_sound.v:67: Cannot find file containing module: 'jtframe_cenp384'\njtframe_cenp384 u_cenp384(\n^~~~~~~~~~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/129527056/cores/trojan/hdl,data/full_repos/permissive/129527056/jtframe_cenp384\n             data/full_repos/permissive/129527056/cores/trojan/hdl,data/full_repos/permissive/129527056/jtframe_cenp384.v\n             data/full_repos/permissive/129527056/cores/trojan/hdl,data/full_repos/permissive/129527056/jtframe_cenp384.sv\n             jtframe_cenp384\n             jtframe_cenp384.v\n             jtframe_cenp384.sv\n             obj_dir/jtframe_cenp384\n             obj_dir/jtframe_cenp384.v\n             obj_dir/jtframe_cenp384.sv\n%Error: data/full_repos/permissive/129527056/cores/trojan/hdl/jttrojan_sound.v:72: Cannot find file containing module: 'jtgng_sound'\njtgng_sound #(.LAYOUT(0)) u_fmcpu (\n^~~~~~~~~~~\n%Error: data/full_repos/permissive/129527056/cores/trojan/hdl/jttrojan_sound.v:94: Cannot find file containing module: 'jttora_adpcm'\njttora_adpcm u_adpcmcpu(\n^~~~~~~~~~~~\n%Error: data/full_repos/permissive/129527056/cores/trojan/hdl/jttrojan_sound.v:110: Cannot find file containing module: 'jtframe_mixer'\njtframe_mixer #(.W0(16),.W1(12)) u_mixer(\n^~~~~~~~~~~~~\n%Error: Exiting due to 4 error(s)\n"
module jttrojan_sound(
    input           rst,
    input           clk,
    input           cen3,
    input           cen1p5,

    input           sres_b,
    input           snd_int,
    input   [7:0]   snd_latch,
    input   [7:0]   snd2_latch,

    input           enable_psg,
    input           enable_fm,
    input   [1:0]   psg_level,

    output  [14:0]  rom_addr,
    output          rom_cs,
    input   [ 7:0]  rom_data,
    input           rom_ok,

    output  [13:0]  rom2_addr,
    output          rom2_cs,
    input   [ 7:0]  rom2_data,
    input           rom2_ok,


    output signed [15:0] ym_snd,
    output               sample,
    output reg           peak,
    output        [ 7:0] debug_view
);

wire signed [15:0] fm_snd;
wire signed [11:0] adpcm_snd;
wire               cenp384;
wire               fm_peak, mix_peak;
reg         [ 7:0] pcm_gain;

always @(posedge clk) begin
    peak <= fm_peak | mix_peak;
    case( psg_level )
        2'd0: pcm_gain <= 8'h04;
        2'd1: pcm_gain <= 8'h08;
        2'd2: pcm_gain <= 8'h10;
        2'd3: pcm_gain <= 8'h20;
    endcase
end

jtframe_cenp384 u_cenp384(
    .clk      ( clk       ),
    .cen_p384 ( cenp384   )
);

jtgng_sound #(.LAYOUT(0)) u_fmcpu (
    .rst        (  rst          ),
    .clk        (  clk          ),
    .cen3       (  cen3         ),
    .cen1p5     (  cen1p5       ),
    .sres_b     (  sres_b       ),
    .snd_latch  (  snd_latch    ),
    .snd2_latch (               ),
    .snd_int    (  snd_int      ),
    .enable_psg (  enable_psg   ),
    .enable_fm  (  enable_fm    ),
    .psg_level  (  psg_level    ),
    .rom_addr   (  rom_addr     ),
    .rom_cs     (  rom_cs       ),
    .rom_data   (  rom_data     ),
    .rom_ok     (  rom_ok       ),
    .ym_snd     (  fm_snd       ),
    .sample     (  sample       ),
    .peak       (  fm_peak      ),
    .debug_view ( debug_view    )
);

jttora_adpcm u_adpcmcpu(
    .rst        ( rst           ),
    .clk        ( clk           ),
    .cen3       ( cen3          ),
    .cenp384    ( cenp384       ),

    .snd2_latch ( snd2_latch    ),

    .rom2_addr  ( rom2_addr     ),
    .rom2_cs    ( rom2_cs       ),
    .rom2_data  ( rom2_data     ),
    .rom2_ok    ( rom2_ok       ),

    .snd        ( adpcm_snd     )
);

jtframe_mixer #(.W0(16),.W1(12)) u_mixer(
    .rst    ( rst       ),
    .clk    ( clk       ),
    .cen    ( cen1p5    ),

    .ch0    ( fm_snd    ),
    .ch1    ( adpcm_snd ),
    .ch2    ( 16'd0     ),
    .ch3    ( 16'd0     ),

    .gain0  ( 8'h10     ),
    .gain1  ( pcm_gain  ),
    .gain2  ( 8'h00     ),
    .gain3  ( 8'h00     ),
    .mixed  ( ym_snd    ),
    .peak   ( mix_peak  )
);

endmodule
module jttrojan_sound(
    input           rst,
    input           clk,
    input           cen3,
    input           cen1p5,

    input           sres_b,
    input           snd_int,
    input   [7:0]   snd_latch,
    input   [7:0]   snd2_latch,

    input           enable_psg,
    input           enable_fm,
    input   [1:0]   psg_level,

    output  [14:0]  rom_addr,
    output          rom_cs,
    input   [ 7:0]  rom_data,
    input           rom_ok,

    output  [13:0]  rom2_addr,
    output          rom2_cs,
    input   [ 7:0]  rom2_data,
    input           rom2_ok,


    output signed [15:0] ym_snd,
    output               sample,
    output reg           peak,
    output        [ 7:0] debug_view
);


wire signed [15:0] fm_snd;
wire signed [11:0] adpcm_snd;
wire               cenp384;
wire               fm_peak, mix_peak;
reg         [ 7:0] pcm_gain;

always @(posedge clk) begin
    peak <= fm_peak | mix_peak;
    case( psg_level )
        2'd0: pcm_gain <= 8'h04;
        2'd1: pcm_gain <= 8'h08;
        2'd2: pcm_gain <= 8'h10;
        2'd3: pcm_gain <= 8'h20;
    endcase
end

jtframe_cenp384 u_cenp384(
    .clk      ( clk       ),
    .cen_p384 ( cenp384   )
);

jtgng_sound #(.LAYOUT(0)) u_fmcpu (
    .rst        (  rst          ),
    .clk        (  clk          ),
    .cen3       (  cen3         ),
    .cen1p5     (  cen1p5       ),
    .sres_b     (  sres_b       ),
    .snd_latch  (  snd_latch    ),
    .snd2_latch (               ),
    .snd_int    (  snd_int      ),
    .enable_psg (  enable_psg   ),
    .enable_fm  (  enable_fm    ),
    .psg_level  (  psg_level    ),
    .rom_addr   (  rom_addr     ),
    .rom_cs     (  rom_cs       ),
    .rom_data   (  rom_data     ),
    .rom_ok     (  rom_ok       ),
    .ym_snd     (  fm_snd       ),
    .sample     (  sample       ),
    .peak       (  fm_peak      ),
    .debug_view ( debug_view    )
);

jttora_adpcm u_adpcmcpu(
    .rst        ( rst           ),
    .clk        ( clk           ),
    .cen3       ( cen3          ),
    .cenp384    ( cenp384       ),

    .snd2_latch ( snd2_latch    ),

    .rom2_addr  ( rom2_addr     ),
    .rom2_cs    ( rom2_cs       ),
    .rom2_data  ( rom2_data     ),
    .rom2_ok    ( rom2_ok       ),

    .snd        ( adpcm_snd     )
);

jtframe_mixer #(.W0(16),.W1(12)) u_mixer(
    .rst    ( rst       ),
    .clk    ( clk       ),
    .cen    ( cen1p5    ),

    .ch0    ( fm_snd    ),
    .ch1    ( adpcm_snd ),
    .ch2    ( 16'd0     ),
    .ch3    ( 16'd0     ),

    .gain0  ( 8'h10     ),
    .gain1  ( pcm_gain  ),
    .gain2  ( 8'h00     ),
    .gain3  ( 8'h00     ),
    .mixed  ( ym_snd    ),
    .peak   ( mix_peak  )
);

endmodule