data/full_repos/permissive/45473097/DriveTFT18.srcs/sources_1/DriveTFT18.v
1: b"%Error: data/full_repos/permissive/45473097/DriveTFT18.srcs/sources_1/DriveTFT18.v:32: Cannot find file containing module: 'mcs'\n  mcs mcs_0 (\n  ^~~\n        ... Looked in:\n             data/full_repos/permissive/45473097/DriveTFT18.srcs/sources_1,data/full_repos/permissive/45473097/mcs\n             data/full_repos/permissive/45473097/DriveTFT18.srcs/sources_1,data/full_repos/permissive/45473097/mcs.v\n             data/full_repos/permissive/45473097/DriveTFT18.srcs/sources_1,data/full_repos/permissive/45473097/mcs.sv\n             mcs\n             mcs.v\n             mcs.sv\n             obj_dir/mcs\n             obj_dir/mcs.v\n             obj_dir/mcs.sv\n%Error: data/full_repos/permissive/45473097/DriveTFT18.srcs/sources_1/DriveTFT18.v:44: Cannot find file containing module: 'spi'\n  spi spi (\n  ^~~\n%Error: data/full_repos/permissive/45473097/DriveTFT18.srcs/sources_1/DriveTFT18.v:67: Cannot find file containing module: 'timer_wait'\n  timer_wait timer_wait (\n  ^~~~~~~~~~\n%Error: Exiting due to 3 error(s)\n"
module DriveTFT18(
  input wire clk,
  input wire rsth,
  output wire SCL,
  output wire WRX,
  output wire RESX,
  output wire CSX,
  inout  wire SDA,
  output wire UART_TX,
  output wire [6:0] LED
);

  wire [24:0] w_mcs_gpo;
  wire [31:0] w_rdata;
  wire        w_req           = w_mcs_gpo[24];
  wire [1:0]  w_mod_sel       = w_mcs_gpo[23:22];
  wire [3:0]  w_spi_command   = w_mcs_gpo[21:18];
  wire [17:0] w_wdata         = w_mcs_gpo[17:0];




  wire w_sel_spi      = (w_mod_sel == 2'b00);
  wire w_sel_tft_rst  = (w_mod_sel == 2'b11);
  wire w_sel_timer    = (w_mod_sel == 2'b01);


  wire w_ack_spi, w_ack_wait;
  wire w_ack_all = w_ack_spi & w_ack_wait;

  mcs mcs_0 (
    .Clk(clk),
    .Reset(rsth),
    .UART_Tx(UART_TX),
    .GPO1(w_mcs_gpo),
    .GPI1(w_ack_all),
    .GPI1_Interrupt(),
    .GPI2(w_rdata),
    .GPI2_Interrupt()
  );


  spi spi (
    .clk(clk),
    .rsth(rsth),
    .mod_sel(w_sel_spi),
    .req(w_req),
    .command(w_spi_command),
    .wdata(w_wdata),
    .rdata(w_rdata),
    .ack(w_ack_spi),
    .oSCL(SCL),
    .oDCX(WRX),
    .oCSX(CSX),
    .oSDA(SDA)
  );


  reg r_rstn;
  always @(posedge clk) begin
    if(rsth)          r_rstn <= 1'b0;
    if(w_sel_tft_rst) r_rstn <= w_wdata[0];
  end


  timer_wait timer_wait (
    .clk(clk),
    .rsth(rsth),
    .mod_sel(w_sel_timer),
    .req(w_req),
    .w_wdata(w_wdata),
    .ack(w_ack_wait)
  );

  assign RESX = r_rstn;

  assign LED[6]   = SCL;
  assign LED[5]   = WRX;
  assign LED[4]   = CSX;
  assign LED[3]   = SDA;
  assign LED[2]   = w_req;
  assign LED[1]   = w_ack_spi;
  assign LED[0]   = w_ack_wait;




endmodule
module DriveTFT18(
  input wire clk,
  input wire rsth,
  output wire SCL,
  output wire WRX,
  output wire RESX,
  output wire CSX,
  inout  wire SDA,
  output wire UART_TX,
  output wire [6:0] LED
);


  wire [24:0] w_mcs_gpo;
  wire [31:0] w_rdata;
  wire        w_req           = w_mcs_gpo[24];
  wire [1:0]  w_mod_sel       = w_mcs_gpo[23:22];
  wire [3:0]  w_spi_command   = w_mcs_gpo[21:18];
  wire [17:0] w_wdata         = w_mcs_gpo[17:0];




  wire w_sel_spi      = (w_mod_sel == 2'b00);
  wire w_sel_tft_rst  = (w_mod_sel == 2'b11);
  wire w_sel_timer    = (w_mod_sel == 2'b01);


  wire w_ack_spi, w_ack_wait;
  wire w_ack_all = w_ack_spi & w_ack_wait;

  mcs mcs_0 (
    .Clk(clk),
    .Reset(rsth),
    .UART_Tx(UART_TX),
    .GPO1(w_mcs_gpo),
    .GPI1(w_ack_all),
    .GPI1_Interrupt(),
    .GPI2(w_rdata),
    .GPI2_Interrupt()
  );


  spi spi (
    .clk(clk),
    .rsth(rsth),
    .mod_sel(w_sel_spi),
    .req(w_req),
    .command(w_spi_command),
    .wdata(w_wdata),
    .rdata(w_rdata),
    .ack(w_ack_spi),
    .oSCL(SCL),
    .oDCX(WRX),
    .oCSX(CSX),
    .oSDA(SDA)
  );


  reg r_rstn;
  always @(posedge clk) begin
    if(rsth)          r_rstn <= 1'b0;
    if(w_sel_tft_rst) r_rstn <= w_wdata[0];
  end


  timer_wait timer_wait (
    .clk(clk),
    .rsth(rsth),
    .mod_sel(w_sel_timer),
    .req(w_req),
    .w_wdata(w_wdata),
    .ack(w_ack_wait)
  );

  assign RESX = r_rstn;

  assign LED[6]   = SCL;
  assign LED[5]   = WRX;
  assign LED[4]   = CSX;
  assign LED[3]   = SDA;
  assign LED[2]   = w_req;
  assign LED[1]   = w_ack_spi;
  assign LED[0]   = w_ack_wait;




endmodule