Table of contents

Alhambra II FPGA

%3 cluster_8ae4347a_c1f6_4d67_a636_b4ba7e8583f7 Alhambra II FPGA cluster_e0d70001_99e1_40c9_a4c6_45914fa8efdc Tools cluster_aafbc3e8_2ae8_409a_85a4_01fbf9ce7a47 Icestudio cluster_b2955073_4291_49b4_bb30_3d1387390568 Parts cluster_7af29d78_f47c_4597_96f8_688af38bf50d Tests _1f7dab5d_6ee1_4460_9295_ea48d2692ac8 Yosys _5c41746a_3c90_4056_9ad2_d64fb70c8c63 Icestorm _fa8d381b_ca34_4e08_8719_34c3bdd07ec4 Cli tool _d227ab97_5154_42be_a9df_9ac74800cc72 Prescaler is used to divide CLK speed _7fdd26a0_4ca1_421b_a29e_7aa0c5745b76 Count forward and backwards _d30acafd_65d7_4e0c_a7ad_1163bd44d911 SymbiFlow _79423e0d_03aa_439e_a23f_b01c4132bf53 APIO _79423e0d_03aa_439e_a23f_b01c4132bf53->_7fdd26a0_4ca1_421b_a29e_7aa0c5745b76 _79423e0d_03aa_439e_a23f_b01c4132bf53->__0:cluster_aafbc3e8_2ae8_409a_85a4_01fbf9ce7a47 _ea48ec1d_f9d4_4fb7_b39a_faa7b6e2ba95 Notes index _ea48ec1d_f9d4_4fb7_b39a_faa7b6e2ba95->__1:cluster_e0d70001_99e1_40c9_a4c6_45914fa8efdc _f5f9b11c_d999_4913_84b9_472d66c3a5a2 Verilog _d4310ed9_2057_4538_9ab2_4ac12a2769b3 SymbiFlow _d4310ed9_2057_4538_9ab2_4ac12a2769b3->__2:cluster_8ae4347a_c1f6_4d67_a636_b4ba7e8583f7 _08e82287_b2c3_4623_a6b6_a5824bb5a22d Hardware __3:cluster_8ae4347a_c1f6_4d67_a636_b4ba7e8583f7->_f5f9b11c_d999_4913_84b9_472d66c3a5a2 __4:cluster_8ae4347a_c1f6_4d67_a636_b4ba7e8583f7->_08e82287_b2c3_4623_a6b6_a5824bb5a22d __5:cluster_aafbc3e8_2ae8_409a_85a4_01fbf9ce7a47->_5c41746a_3c90_4056_9ad2_d64fb70c8c63

Tools

DONE

Icestudio

  • GitHub

    https://github.com/FPGAwars/icestudio

  • Frontend for

    Icestorm

  • It's a great way to build little circuits to get a feeling for the FPGA. For example the following circuit will light LED 0 if the button 1 is pushed, otherwise LED7 would be the one active.

  • Might be necessary to launch it as root (with sudo).

  • Icestudio files are encoded in JSON.

  • Can be used to export verilog code

Tests

Count forward and backwards

  • Count forwards normally, backwards when button pressed

  • Verilog code

// Code generated by Icestudio 0.5.0
// Mon, 22 Mar 2021 22:15:57 GMT

`default_nettype none

module main #(
 parameter v2fb628 = 19
) (
 input vaef181,
 input vclk,
 output [7:0] v31451a
);
 localparam p1 = v2fb628;
 wire [0:7] w0;
 wire w2;
 wire w3;
 wire w4;
 assign v31451a = w0;
 assign w3 = vaef181;
 assign w4 = vclk;
 v6a5074 #(
  .v100e1b(p1)
 ) vbb0b73 (
  .v2efea4(w2),
  .v0daa9e(w4)
 );
 main_v243a90 v243a90 (
  .value(w0),
  .clk(w2),
  .btn(w3)
 );
endmodule

module v6a5074 #(
 parameter v100e1b = 22
) (
 input v0daa9e,
 output v2efea4
);
 localparam p2 = v100e1b;
 wire w0;
 wire w1;
 assign v2efea4 = w0;
 assign w1 = v0daa9e;
 v6a5074_vac7386 #(
  .N(p2)
 ) vac7386 (
  .clk_out(w0),
  .clk_in(w1)
 );
endmodule

module v6a5074_vac7386 #(
 parameter N = 0
) (
 input clk_in,
 output clk_out
);
 //-- Number of bits of the prescaler
 //parameter N = 22;

 //-- divisor register
 reg [N-1:0] divcounter;

 //-- N bit counter
 always @(posedge clk_in)
   divcounter <= divcounter + 1;

 //-- Use the most significant bit as output
 assign clk_out = divcounter[N-1];
endmodule

module main_v243a90 (
 input clk,
 input btn,
 output [7:0] value
);
 reg [7:0] value;

 always @(posedge clk) begin
   if (btn == 1)
     value <= value - 1;
   else
     value <= value + 1;
 end


endmodule

TODO

APIO

  • Environment/package collection for open FPGAs

  • Used by

    Icestudio

  • Given a Verilog file, like Count forward and backwards

    • It can be sent to a FPGA with apio build -b alhambra-ii

    • If normal apio doesn't generate files, try with the one on Icestudio's venv

TODO

Yosys