data/full_repos/permissive/156407853/Files/Verilog/raggedstone_spinn_aer_if/raggedstone_spinn_aer_if_top.v
None: at end of input
1: b'%Error: data/full_repos/permissive/156407853/Files/Verilog/raggedstone_spinn_aer_if/raggedstone_spinn_aer_if_top.v:24: Cannot find include file: raggedstone_spinn_aer_if_top.h\n`include "raggedstone_spinn_aer_if_top.h" \n         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/156407853/Files/Verilog/raggedstone_spinn_aer_if,data/full_repos/permissive/156407853/raggedstone_spinn_aer_if_top.h\n             data/full_repos/permissive/156407853/Files/Verilog/raggedstone_spinn_aer_if,data/full_repos/permissive/156407853/raggedstone_spinn_aer_if_top.h.v\n             data/full_repos/permissive/156407853/Files/Verilog/raggedstone_spinn_aer_if,data/full_repos/permissive/156407853/raggedstone_spinn_aer_if_top.h.sv\n             raggedstone_spinn_aer_if_top.h\n             raggedstone_spinn_aer_if_top.h.v\n             raggedstone_spinn_aer_if_top.h.sv\n             obj_dir/raggedstone_spinn_aer_if_top.h\n             obj_dir/raggedstone_spinn_aer_if_top.h.v\n             obj_dir/raggedstone_spinn_aer_if_top.h.sv\n%Error: data/full_repos/permissive/156407853/Files/Verilog/raggedstone_spinn_aer_if/raggedstone_spinn_aer_if_top.v:25: Cannot find include file: spio_spinnaker_link.h\n`include "spio_spinnaker_link.h" \n         ^~~~~~~~~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/156407853/Files/Verilog/raggedstone_spinn_aer_if/raggedstone_spinn_aer_if_top.v:104: Define or directive not defined: \'`PKT_BITS\'\n  wire [`PKT_BITS - 1:0] spkt_data;\n        ^~~~~~~~~\n%Error: data/full_repos/permissive/156407853/Files/Verilog/raggedstone_spinn_aer_if/raggedstone_spinn_aer_if_top.v:108: Define or directive not defined: \'`PKT_BITS\'\n  wire [`PKT_BITS - 1:0] opkt_data;\n        ^~~~~~~~~\n%Error: data/full_repos/permissive/156407853/Files/Verilog/raggedstone_spinn_aer_if/raggedstone_spinn_aer_if_top.v:112: Define or directive not defined: \'`PKT_BITS\'\n  wire [`PKT_BITS - 1:0] cpkt_data;\n        ^~~~~~~~~\n%Error: data/full_repos/permissive/156407853/Files/Verilog/raggedstone_spinn_aer_if/raggedstone_spinn_aer_if_top.v:116: Define or directive not defined: \'`PKT_BITS\'\n  wire [`PKT_BITS - 1:0] mpkt_data;\n        ^~~~~~~~~\n%Error: data/full_repos/permissive/156407853/Files/Verilog/raggedstone_spinn_aer_if/raggedstone_spinn_aer_if_top.v:120: Define or directive not defined: \'`PKT_BITS\'\n  wire [`PKT_BITS - 1:0] ipkt_data;\n        ^~~~~~~~~\n%Error: data/full_repos/permissive/156407853/Files/Verilog/raggedstone_spinn_aer_if/raggedstone_spinn_aer_if_top.v:127: Define or directive not defined: \'`MODE_BITS\'\n  wire [`MODE_BITS - 1:0] vmode;\n        ^~~~~~~~~~\n%Error: data/full_repos/permissive/156407853/Files/Verilog/raggedstone_spinn_aer_if/raggedstone_spinn_aer_if_top.v:128: Define or directive not defined: \'`VKEY_BITS\'\n  wire [`VKEY_BITS - 1:0] vkey;\n        ^~~~~~~~~~\n%Error: data/full_repos/permissive/156407853/Files/Verilog/raggedstone_spinn_aer_if/raggedstone_spinn_aer_if_top.v:132: Define or directive not defined: \'`VKS_BITS\'\n  wire  [`VKS_BITS - 1:0] vksel;\n         ^~~~~~~~~\n%Error: data/full_repos/permissive/156407853/Files/Verilog/raggedstone_spinn_aer_if/raggedstone_spinn_aer_if_top.v:133: Define or directive not defined: \'`MODE_BITS\'\n  wire [`MODE_BITS - 1:0] msel;\n        ^~~~~~~~~~\n%Error: data/full_repos/permissive/156407853/Files/Verilog/raggedstone_spinn_aer_if/raggedstone_spinn_aer_if_top.v:286: Define or directive not defined: \'`DUMP_CNT\'\n    .DUMP_CNT  (`DUMP_CNT)\n                ^~~~~~~~~\n%Error: Exiting due to 12 error(s)\n'
module raggedstone_spinn_aer_if_top
#(

  parameter DBNCER_CONST = 20'hfffff
)
(
  input wire         ext_nreset,
  input wire         ext_clk,


  input  wire        ext_mode_sel,
  output wire  [7:0] ext_7seg,
  output wire  [3:0] ext_strobe,
  output wire        ext_led2,
  output wire        ext_led3,
  output wire        ext_led4,
  output wire        ext_led5,


  input  wire  [6:0] data_2of7_from_spinnaker,
  output wire        ack_to_spinnaker,


  output wire  [6:0] data_2of7_to_spinnaker,
  input  wire        ack_from_spinnaker,


  input  wire [15:0] iaer_data,
  input  wire        iaer_req,
  output wire        iaer_ack,


  output wire [15:0] oaer_data,
  output wire        oaer_req,
  input  wire        oaer_ack
);



  wire        i_nreset;
  wire        rst_unlocked;
  wire        rst;
  wire        cg_locked;

  wire        clk;
  wire        clk_32;
  wire        clk_64;
  wire        clk_96;

  wire        clk_sync;
  wire        clk_mod;
  wire        clk_deb;



  wire  [6:0] i_ispinn_data;
  wire        i_ispinn_ack;

  wire  [6:0] i_ospinn_data;
  wire        i_ospinn_ack;



  wire [15:0] i_iaer_data;
  wire        i_iaer_req;
  wire        s_iaer_req;
  wire        i_iaer_ack;

  wire [15:0] i_oaer_data;
  wire        i_oaer_req;
  wire        i_oaer_ack;
  wire        s_oaer_ack;



  wire [`PKT_BITS - 1:0] spkt_data;
  wire                   spkt_vld;
  wire                   spkt_rdy;

  wire [`PKT_BITS - 1:0] opkt_data;
  wire                   opkt_vld;
  wire                   opkt_rdy;

  wire [`PKT_BITS - 1:0] cpkt_data;
  wire                   cpkt_vld;
  wire                   cpkt_rdy;

  wire [`PKT_BITS - 1:0] mpkt_data;
  wire                   mpkt_vld;
  wire                   mpkt_rdy;

  wire [`PKT_BITS - 1:0] ipkt_data;
  wire                   ipkt_vld;
  wire                   ipkt_rdy;



  wire                    ct_event_go;
  wire [`MODE_BITS - 1:0] vmode;
  wire [`VKEY_BITS - 1:0] vkey;



  wire  [`VKS_BITS - 1:0] vksel;
  wire [`MODE_BITS - 1:0] msel;
  wire                    dump_mode;

  wire                    mode_sel;
  wire                    mode_sel_debounced;
  wire              [7:0] o_7seg;
  wire              [3:0] o_strobe;
  wire                    led2;
  wire                    led4;
  wire                    led5;

  wire                    err_flt;
  wire                    err_frm;
  wire                    err_gch;












  spio_spinnaker_link_sync
  #(
    .SIZE  (1)
  ) sreq
  (
    .CLK_IN (clk_sync),
    .IN     (i_iaer_req),
    .OUT    (s_iaer_req)
   );






  spio_spinnaker_link_sync
  #(
    .SIZE  (1)
  ) sack
  (
    .CLK_IN (clk_sync),
    .IN     (i_oaer_ack),
    .OUT    (s_oaer_ack)
   );







  spio_spinnaker_link_synchronous_receiver sr
  (
    .RESET_IN        (rst),
    .CLK_IN          (clk_mod),
    .FLT_ERR_OUT     (err_flt),
    .FRM_ERR_OUT     (err_frm),
    .GCH_ERR_OUT     (err_gch),
    .SL_DATA_2OF7_IN (i_ispinn_data),
    .SL_ACK_OUT      (i_ispinn_ack),
    .PKT_DATA_OUT    (spkt_data),
    .PKT_VLD_OUT     (spkt_vld),
    .PKT_RDY_IN      (spkt_rdy)
  );






  raggedstone_spinn_aer_if_router pr
  (
    .rst       (rst),
    .clk       (clk_mod),
    .spkt_data (spkt_data),
    .spkt_vld  (spkt_vld),
    .spkt_rdy  (spkt_rdy),
    .opkt_data (opkt_data),
    .opkt_vld  (opkt_vld),
    .opkt_rdy  (opkt_rdy),
    .cpkt_data (cpkt_data),
    .cpkt_vld  (cpkt_vld),
    .cpkt_rdy  (cpkt_rdy)
  );






  spio_spinn2aer_mapper om
  (
    .rst       (rst),
    .clk       (clk_mod),
    .opkt_data (opkt_data),
    .opkt_vld  (opkt_vld),
    .opkt_rdy  (opkt_rdy),
    .oaer_data (i_oaer_data),
    .oaer_req  (i_oaer_req),
    .oaer_ack  (s_oaer_ack)
  );






  raggedstone_spinn_aer_if_control ct
  (
    .rst       (rst),
    .clk       (clk_mod),
    .cpkt_data (cpkt_data),
    .cpkt_vld  (cpkt_vld),
    .cpkt_rdy  (cpkt_rdy),
    .msel      (msel),
    .vksel     (vksel),
    .vmode     (vmode),
    .vkey      (vkey),
    .go        (ct_event_go)
  );






  spio_aer2spinn_mapper im
  (
    .rst       (rst),
    .clk       (clk_mod),
    .vmode     (vmode),
    .vkey      (vkey),
    .iaer_data (i_iaer_data),
    .iaer_req  (s_iaer_req),
    .iaer_ack  (i_iaer_ack),
    .ipkt_data (mpkt_data),
    .ipkt_vld  (mpkt_vld),
    .ipkt_rdy  (mpkt_rdy)
  );






  raggedstone_spinn_aer_if_dump
  #(
    .DUMP_CNT  (`DUMP_CNT)
  ) pd
  (
    .rst       (rst),
    .clk       (clk_mod),
    .go        (ct_event_go),
    .dump_mode (dump_mode),
    .mpkt_data (mpkt_data),
    .mpkt_vld  (mpkt_vld),
    .mpkt_rdy  (mpkt_rdy),
    .ipkt_data (ipkt_data),
    .ipkt_vld  (ipkt_vld),
    .ipkt_rdy  (ipkt_rdy)
  );






  spio_spinnaker_link_synchronous_sender sd
  (
    .RESET_IN         (rst),
    .CLK_IN           (clk_mod),
    .ACK_ERR_OUT      (),
    .TMO_ERR_OUT      (),
    .PKT_DATA_IN      (ipkt_data),
    .PKT_VLD_IN       (ipkt_vld),
    .PKT_RDY_OUT      (ipkt_rdy),
    .SL_DATA_2OF7_OUT (i_ospinn_data),
    .SL_ACK_IN        (i_ospinn_ack)
  );

 
  






  raggedstone_spinn_aer_if_debouncer
  #(
    .DBNCER_CONST (DBNCER_CONST),
    .RESET_VALUE  (1'b1)
  ) md
  (
    .rst          (rst),
    .clk          (clk_deb),
    .pb_input     (mode_sel),
    .pb_debounced (mode_sel_debounced)
  );

  raggedstone_spinn_aer_if_user_int ui
  (
    .rst       (rst),
    .clk       (clk_mod),
    .mode_sel  (mode_sel_debounced),
    .dump_mode (dump_mode),
    .error     (err_flt | err_frm | err_gch),
    .msel      (msel),
    .vksel     (vksel),
    .o_7seg    (o_7seg),
    .o_strobe  (o_strobe),
    .o_led_act (led2),
    .o_led_dmp (led4),
    .o_led_err (led5)
  );









  raggedstone_spinn_aer_if_debouncer
  #(
    .DBNCER_CONST (DBNCER_CONST)
  ) rd
  (
    .rst          (1'b0),
    .clk          (clk_deb),
    .pb_input     (~i_nreset),
    .pb_debounced (rst_unlocked)
  );





  assign rst = rst_unlocked;






  
  assign clk_sync = clk;
  assign clk_mod  = clk;
  assign clk_deb  = clk;












  assign clk = ext_clk;

  assign i_nreset = ext_nreset;

  assign ext_led2 = led2;

  assign ext_led3 = rst;

  assign ext_led4 = led4;

  assign ext_led5 = led5;

  assign mode_sel = ext_mode_sel;








  assign data_2of7_to_spinnaker = i_ospinn_data;
  



  assign i_ospinn_ack = ack_from_spinnaker;




  assign i_ispinn_data = data_2of7_from_spinnaker;
  



  assign ack_to_spinnaker = i_ispinn_ack;






  assign i_iaer_req = iaer_req;
  

  assign i_iaer_data = iaer_data;
  

  assign iaer_ack = i_iaer_ack;


  assign oaer_req = i_oaer_req;
  

  assign oaer_data = i_oaer_data;
  

  assign i_oaer_ack = oaer_ack;







endmodule
module raggedstone_spinn_aer_if_top
#(

  parameter DBNCER_CONST = 20'hfffff
)
(
  input wire         ext_nreset,
  input wire         ext_clk,


  input  wire        ext_mode_sel,
  output wire  [7:0] ext_7seg,
  output wire  [3:0] ext_strobe,
  output wire        ext_led2,
  output wire        ext_led3,
  output wire        ext_led4,
  output wire        ext_led5,


  input  wire  [6:0] data_2of7_from_spinnaker,
  output wire        ack_to_spinnaker,


  output wire  [6:0] data_2of7_to_spinnaker,
  input  wire        ack_from_spinnaker,


  input  wire [15:0] iaer_data,
  input  wire        iaer_req,
  output wire        iaer_ack,


  output wire [15:0] oaer_data,
  output wire        oaer_req,
  input  wire        oaer_ack
);




  wire        i_nreset;
  wire        rst_unlocked;
  wire        rst;
  wire        cg_locked;

  wire        clk;
  wire        clk_32;
  wire        clk_64;
  wire        clk_96;

  wire        clk_sync;
  wire        clk_mod;
  wire        clk_deb;



  wire  [6:0] i_ispinn_data;
  wire        i_ispinn_ack;

  wire  [6:0] i_ospinn_data;
  wire        i_ospinn_ack;



  wire [15:0] i_iaer_data;
  wire        i_iaer_req;
  wire        s_iaer_req;
  wire        i_iaer_ack;

  wire [15:0] i_oaer_data;
  wire        i_oaer_req;
  wire        i_oaer_ack;
  wire        s_oaer_ack;



  wire [`PKT_BITS - 1:0] spkt_data;
  wire                   spkt_vld;
  wire                   spkt_rdy;

  wire [`PKT_BITS - 1:0] opkt_data;
  wire                   opkt_vld;
  wire                   opkt_rdy;

  wire [`PKT_BITS - 1:0] cpkt_data;
  wire                   cpkt_vld;
  wire                   cpkt_rdy;

  wire [`PKT_BITS - 1:0] mpkt_data;
  wire                   mpkt_vld;
  wire                   mpkt_rdy;

  wire [`PKT_BITS - 1:0] ipkt_data;
  wire                   ipkt_vld;
  wire                   ipkt_rdy;



  wire                    ct_event_go;
  wire [`MODE_BITS - 1:0] vmode;
  wire [`VKEY_BITS - 1:0] vkey;



  wire  [`VKS_BITS - 1:0] vksel;
  wire [`MODE_BITS - 1:0] msel;
  wire                    dump_mode;

  wire                    mode_sel;
  wire                    mode_sel_debounced;
  wire              [7:0] o_7seg;
  wire              [3:0] o_strobe;
  wire                    led2;
  wire                    led4;
  wire                    led5;

  wire                    err_flt;
  wire                    err_frm;
  wire                    err_gch;












  spio_spinnaker_link_sync
  #(
    .SIZE  (1)
  ) sreq
  (
    .CLK_IN (clk_sync),
    .IN     (i_iaer_req),
    .OUT    (s_iaer_req)
   );






  spio_spinnaker_link_sync
  #(
    .SIZE  (1)
  ) sack
  (
    .CLK_IN (clk_sync),
    .IN     (i_oaer_ack),
    .OUT    (s_oaer_ack)
   );







  spio_spinnaker_link_synchronous_receiver sr
  (
    .RESET_IN        (rst),
    .CLK_IN          (clk_mod),
    .FLT_ERR_OUT     (err_flt),
    .FRM_ERR_OUT     (err_frm),
    .GCH_ERR_OUT     (err_gch),
    .SL_DATA_2OF7_IN (i_ispinn_data),
    .SL_ACK_OUT      (i_ispinn_ack),
    .PKT_DATA_OUT    (spkt_data),
    .PKT_VLD_OUT     (spkt_vld),
    .PKT_RDY_IN      (spkt_rdy)
  );






  raggedstone_spinn_aer_if_router pr
  (
    .rst       (rst),
    .clk       (clk_mod),
    .spkt_data (spkt_data),
    .spkt_vld  (spkt_vld),
    .spkt_rdy  (spkt_rdy),
    .opkt_data (opkt_data),
    .opkt_vld  (opkt_vld),
    .opkt_rdy  (opkt_rdy),
    .cpkt_data (cpkt_data),
    .cpkt_vld  (cpkt_vld),
    .cpkt_rdy  (cpkt_rdy)
  );






  spio_spinn2aer_mapper om
  (
    .rst       (rst),
    .clk       (clk_mod),
    .opkt_data (opkt_data),
    .opkt_vld  (opkt_vld),
    .opkt_rdy  (opkt_rdy),
    .oaer_data (i_oaer_data),
    .oaer_req  (i_oaer_req),
    .oaer_ack  (s_oaer_ack)
  );






  raggedstone_spinn_aer_if_control ct
  (
    .rst       (rst),
    .clk       (clk_mod),
    .cpkt_data (cpkt_data),
    .cpkt_vld  (cpkt_vld),
    .cpkt_rdy  (cpkt_rdy),
    .msel      (msel),
    .vksel     (vksel),
    .vmode     (vmode),
    .vkey      (vkey),
    .go        (ct_event_go)
  );






  spio_aer2spinn_mapper im
  (
    .rst       (rst),
    .clk       (clk_mod),
    .vmode     (vmode),
    .vkey      (vkey),
    .iaer_data (i_iaer_data),
    .iaer_req  (s_iaer_req),
    .iaer_ack  (i_iaer_ack),
    .ipkt_data (mpkt_data),
    .ipkt_vld  (mpkt_vld),
    .ipkt_rdy  (mpkt_rdy)
  );






  raggedstone_spinn_aer_if_dump
  #(
    .DUMP_CNT  (`DUMP_CNT)
  ) pd
  (
    .rst       (rst),
    .clk       (clk_mod),
    .go        (ct_event_go),
    .dump_mode (dump_mode),
    .mpkt_data (mpkt_data),
    .mpkt_vld  (mpkt_vld),
    .mpkt_rdy  (mpkt_rdy),
    .ipkt_data (ipkt_data),
    .ipkt_vld  (ipkt_vld),
    .ipkt_rdy  (ipkt_rdy)
  );






  spio_spinnaker_link_synchronous_sender sd
  (
    .RESET_IN         (rst),
    .CLK_IN           (clk_mod),
    .ACK_ERR_OUT      (),
    .TMO_ERR_OUT      (),
    .PKT_DATA_IN      (ipkt_data),
    .PKT_VLD_IN       (ipkt_vld),
    .PKT_RDY_OUT      (ipkt_rdy),
    .SL_DATA_2OF7_OUT (i_ospinn_data),
    .SL_ACK_IN        (i_ospinn_ack)
  );

 
  






  raggedstone_spinn_aer_if_debouncer
  #(
    .DBNCER_CONST (DBNCER_CONST),
    .RESET_VALUE  (1'b1)
  ) md
  (
    .rst          (rst),
    .clk          (clk_deb),
    .pb_input     (mode_sel),
    .pb_debounced (mode_sel_debounced)
  );

  raggedstone_spinn_aer_if_user_int ui
  (
    .rst       (rst),
    .clk       (clk_mod),
    .mode_sel  (mode_sel_debounced),
    .dump_mode (dump_mode),
    .error     (err_flt | err_frm | err_gch),
    .msel      (msel),
    .vksel     (vksel),
    .o_7seg    (o_7seg),
    .o_strobe  (o_strobe),
    .o_led_act (led2),
    .o_led_dmp (led4),
    .o_led_err (led5)
  );









  raggedstone_spinn_aer_if_debouncer
  #(
    .DBNCER_CONST (DBNCER_CONST)
  ) rd
  (
    .rst          (1'b0),
    .clk          (clk_deb),
    .pb_input     (~i_nreset),
    .pb_debounced (rst_unlocked)
  );





  assign rst = rst_unlocked;






  
  assign clk_sync = clk;
  assign clk_mod  = clk;
  assign clk_deb  = clk;












  assign clk = ext_clk;

  assign i_nreset = ext_nreset;

  assign ext_led2 = led2;

  assign ext_led3 = rst;

  assign ext_led4 = led4;

  assign ext_led5 = led5;

  assign mode_sel = ext_mode_sel;








  assign data_2of7_to_spinnaker = i_ospinn_data;
  



  assign i_ospinn_ack = ack_from_spinnaker;




  assign i_ispinn_data = data_2of7_from_spinnaker;
  



  assign ack_to_spinnaker = i_ispinn_ack;






  assign i_iaer_req = iaer_req;
  

  assign i_iaer_data = iaer_data;
  

  assign iaer_ack = i_iaer_ack;


  assign oaer_req = i_oaer_req;
  

  assign oaer_data = i_oaer_data;
  

  assign i_oaer_ack = oaer_ack;







endmodule