data/full_repos/permissive/204736068/SoM/RTL/servo/top.sv
[Errno 2] No such file or directory: 'preprocess.output'
1: b'%Error: data/full_repos/permissive/204736068/SoM/RTL/servo/top.sv:47: Cannot find file containing module: \'SB_LFOSC\'\n   SB_LFOSC SB_LFOSC_inst(.CLKLFEN(1\'b1), .CLKLFPU(1\'b1), .CLKLF(clk_10k) );\n   ^~~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/204736068/SoM/RTL/servo,data/full_repos/permissive/204736068/SB_LFOSC\n             data/full_repos/permissive/204736068/SoM/RTL/servo,data/full_repos/permissive/204736068/SB_LFOSC.v\n             data/full_repos/permissive/204736068/SoM/RTL/servo,data/full_repos/permissive/204736068/SB_LFOSC.sv\n             SB_LFOSC\n             SB_LFOSC.v\n             SB_LFOSC.sv\n             obj_dir/SB_LFOSC\n             obj_dir/SB_LFOSC.v\n             obj_dir/SB_LFOSC.sv\n%Error: data/full_repos/permissive/204736068/SoM/RTL/servo/top.sv:48: Cannot find file containing module: \'SB_HFOSC\'\n   SB_HFOSC #(.CLKHF_DIV("0b10")) SB_HFOSC_inst(.CLKHFEN(1\'b1), .CLKHFPU(1\'b1), .CLKHF(clk_12m) );\n   ^~~~~~~~\n%Error: data/full_repos/permissive/204736068/SoM/RTL/servo/top.sv:59: Cannot find file containing module: \'ice40_resetn\'\n   ice40_resetn u_reset_n (.clk(clk_12m), .resetn(reset_n));\n   ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/204736068/SoM/RTL/servo/top.sv:90: Cannot find file containing module: \'servo\'\n   servo #(.CLK_FREQUENCY(15000000) ) u_servo (.clk(clk_12m), .rst(reset), .pos(servo_pos), .pwm(gpio[0]));   \n   ^~~~~\n%Error: data/full_repos/permissive/204736068/SoM/RTL/servo/top.sv:98: Cannot find file containing module: \'SB_RGBA_DRV\'\n   SB_RGBA_DRV u_led_driver(\n   ^~~~~~~~~~~\n%Error: Exiting due to 5 error(s)\n'
module top (


                  output logic [2:0] gpio,
                  output logic 	     led_red,
                  output logic 	     led_green,
                  output logic 	     led_blue

                  );




   logic 			     clk_10k;
   logic 			     clk_12m;
   
   logic 			     reset_n, reset;
   logic 			     pll_lock;
   
`ifndef SIM

   SB_LFOSC SB_LFOSC_inst(.CLKLFEN(1'b1), .CLKLFPU(1'b1), .CLKLF(clk_10k) );
   SB_HFOSC #(.CLKHF_DIV("0b10")) SB_HFOSC_inst(.CLKHFEN(1'b1), .CLKHFPU(1'b1), .CLKHF(clk_12m) );

`else
   initial clk_10k = 0;
   initial clk_12m = 1;
   always #50000 clk_10k = ~clk_10k;
   always #41.67 clk_12m = ~clk_12m;
   
`endif


   ice40_resetn u_reset_n (.clk(clk_12m), .resetn(reset_n));
   assign reset = ~reset_n;


   logic [21:0] ticker;
   logic tick;
   logic up;
   logic [7:0] servo_pos;
   initial begin 
      ticker = '0;
      up = '0;
      servo_pos = '0;
   end
   always @(posedge clk_12m) ticker <= ticker + 'd1;

   assign tick = (ticker == '1);


   always @(posedge clk_12m) begin
      if (tick)
         if (servo_pos >= 'hFF-'d25)
            up = '0;
         else if (servo_pos <= 'd25)
            up = '1;
   
      if (tick)
         if (up)
            servo_pos <= servo_pos + 'd25;
         else
            servo_pos <= servo_pos - 'd25;
   end
   servo #(.CLK_FREQUENCY(15000000) ) u_servo (.clk(clk_12m), .rst(reset), .pos(servo_pos), .pwm(gpio[0]));   
   





   
   SB_RGBA_DRV u_led_driver(
                            .CURREN(1'b1), 
                            .RGBLEDEN(1'b1),
                            .RGB0PWM(1'b0), 
                            .RGB1PWM(1'b0), 
                            .RGB2PWM(1'b0), 
                            .RGB0(led_red),
                            .RGB1(led_green), 
                            .RGB2(led_blue)
                            );
   defparam u_led_driver.CURRENT_MODE = "0b0" ;
   defparam u_led_driver.RGB0_CURRENT = "0b000001";
   defparam u_led_driver.RGB1_CURRENT = "0b000001";
   defparam u_led_driver.RGB2_CURRENT = "0b000001";
   





   



    
   
endmodule
module top (


                  output logic [2:0] gpio,
                  output logic 	     led_red,
                  output logic 	     led_green,
                  output logic 	     led_blue

                  );





   logic 			     clk_10k;
   logic 			     clk_12m;
   
   logic 			     reset_n, reset;
   logic 			     pll_lock;
   
`ifndef SIM

   SB_LFOSC SB_LFOSC_inst(.CLKLFEN(1'b1), .CLKLFPU(1'b1), .CLKLF(clk_10k) );
   SB_HFOSC #(.CLKHF_DIV("0b10")) SB_HFOSC_inst(.CLKHFEN(1'b1), .CLKHFPU(1'b1), .CLKHF(clk_12m) );

`else
   initial clk_10k = 0;
   initial clk_12m = 1;
   always #50000 clk_10k = ~clk_10k;
   always #41.67 clk_12m = ~clk_12m;
   
`endif


   ice40_resetn u_reset_n (.clk(clk_12m), .resetn(reset_n));
   assign reset = ~reset_n;


   logic [21:0] ticker;
   logic tick;
   logic up;
   logic [7:0] servo_pos;
   initial begin 
      ticker = '0;
      up = '0;
      servo_pos = '0;
   end
   always @(posedge clk_12m) ticker <= ticker + 'd1;

   assign tick = (ticker == '1);


   always @(posedge clk_12m) begin
      if (tick)
         if (servo_pos >= 'hFF-'d25)
            up = '0;
         else if (servo_pos <= 'd25)
            up = '1;
   
      if (tick)
         if (up)
            servo_pos <= servo_pos + 'd25;
         else
            servo_pos <= servo_pos - 'd25;
   end
   servo #(.CLK_FREQUENCY(15000000) ) u_servo (.clk(clk_12m), .rst(reset), .pos(servo_pos), .pwm(gpio[0]));   
   





   
   SB_RGBA_DRV u_led_driver(
                            .CURREN(1'b1), 
                            .RGBLEDEN(1'b1),
                            .RGB0PWM(1'b0), 
                            .RGB1PWM(1'b0), 
                            .RGB2PWM(1'b0), 
                            .RGB0(led_red),
                            .RGB1(led_green), 
                            .RGB2(led_blue)
                            );
   defparam u_led_driver.CURRENT_MODE = "0b0" ;
   defparam u_led_driver.RGB0_CURRENT = "0b000001";
   defparam u_led_driver.RGB1_CURRENT = "0b000001";
   defparam u_led_driver.RGB2_CURRENT = "0b000001";
   





   



    
   
endmodule