fireant quick start guide - jungle-elec/FireAnt GitHub Wiki

Introduction to FireAnt

FireAnt is an affordable USB thumb size breakout board. Empowering by Efinix Trion T8, FireAnt is ready to go with a PC and no extra components. Breadboard friendly design allows a fast application deployment with sensors, peripherals or other interfaces. It comes with header pre-soldered or unsoldered version for quicker hands-on prototyping. It is also an ideal platform for manufacturers and digital design students to engage projects with new Efinix platform.

Table of Content

Features and Specification

  • Efinix Trion T8 FPGA

    • 7384 LE Counts
    • 8 Embedded Multipliers
    • 1 Low Power Oscillator
    • 1 PLL
    • 122.88 kbit Internal RAM
    • Package Size: BGA-81 5x5mm
  • Dimension: 51.4 x 18.3 mm

  • Supply Voltage: VBUS 5V | VCC 3.3V

  • VCCIO: 3.3V

  • Onboard 33.333MHz Crystal Oscillator for PLL

  • 35 GPIOs

  • 6 LED (Incl 4 User-configurable LED)

  • Flash: 8 Mbit Serial NOR Flash

  • Programming Interface:

    • USB 2.0 Hi-Speed(480Mb/s)
    • JTAG (with exposed pin in bottom layer via external JTAG programmer)
  • Development Platform: Efinity Software 2018.4.285

Pinout Diagram

Getting Start

Downloading and Installing Efinity Software

See Installation Guide for detail.

Connecting the FireAnt

Connect the FireAnt to PC using micro-USB cable. Open Efinity Programmer and make sure the USB Target is correct in Configuration. You should be able to see the device name in USB Target (Single RS232-HS). If not, try clicking refresh button on the right hand side. programming-device-step1-1

Programming Device

Download blinky.hex as an example. Click on Select Image File button efinity-programmer-select-image-file next to Image text box.

programming-device-step1-1

Locate and choose blinky.hex in your download directory, then click Open. When return to Efinity Programmer. Tap on Start Program button to begin programming.

programming-device-step1-2

The programming process last for less than 1 minute. When it completes, the FireAnt resets and reload with the freshly downloaded image automatically as shown below.

blinky

You are now able to download custom bitstream onto your FireAnt. The source of project blinky can be found in Resource below for your reference.

Create your own Project

It's time to start creating your own project. In this example, we will create the out-of-box demo project (which is a binary counter) from scratch. The project source is available in Resource below just for your reference.

Firstly, start Efinity Software.

Creating New Project

Click File > Create Project.

creating-new-project-step1-2

Keep the default project directory and change the name to counter. Then click OK.

creating-new-project-step1-2

A blank project is created. You can now add various designs into the project.

Creating New Design File (Verilog)

In the project viewer, right click on the Design group. Choose Create.

creating-new-design-file-step1-1

Input counter for the file name. Then click OK. The verilog design file (counter.v) is created under the project. Double-click on counter.v to start code editor.

creating-new-design-file-step1-2

creating-new-design-file-step1-3

Verilog

Return to code editor. Copy the following code and paste onto counter.v.

module counter(LED, BTN, pll_inst1_RSTN, pll_inst1_LOCKED, pll_inst1_CLKOUT0);

localparam LED_COUNT = 4;
localparam MAX_COUNTER = 30;

output [LED_COUNT-1:0] LED;
input [1:0] BTN;
output pll_inst1_RSTN;
input pll_inst1_LOCKED;
input pll_inst1_CLKOUT0;

wire clk_50m;
wire clk_380;
wire counter_2ms;
wire counter_2ms_posedge;
wire counter_msb;

reg [MAX_COUNTER-1:0] counter = 0;
reg counter_2ms_a;
reg [5:0] btn0_debounce, btn1_debounce;
reg [2:0] shift_counter = 0;


assign pll_inst1_RSTN = 1'b1;
assign clk_50m = pll_inst1_CLKOUT0;
assign LED = ~counter[MAX_COUNTER-1:MAX_COUNTER-LED_COUNT];
assign clk_380 = counter[16];
assign counter_2ms = counter[16];
assign counter_2ms_posedge = (~counter_2ms_a && counter_2ms);


always @ (posedge clk_50m)
begin
	if (pll_inst1_LOCKED)
	begin
		counter <= counter + (1 << shift_counter);
		counter_2ms_a <= counter_2ms;
	end
end


always @ (posedge clk_380)
begin
	if (BTN[0] == 1'b0)
	begin
		if (btn0_debounce >= 6'd20)
		begin
			btn0_debounce <= 6'd20; 
		end
		else
		begin
			btn0_debounce <= btn0_debounce + 6'd1;
		end
	end
	else
	begin
		if (btn0_debounce >= 6'd20)
		begin
			// Subroutine for BTN1 being pressed
			shift_counter <= shift_counter < 3'd7 ? shift_counter + 3'd1 : 3'd7;
		end
				
		btn0_debounce <= 6'd0;
	end

	if (BTN[1] == 1'b0)
	begin
		if (btn1_debounce >= 6'd20)
		begin
			btn1_debounce <= 6'd20; 
		end
		else
		begin
			btn1_debounce <= btn1_debounce + 6'd1;
		end
	end
	else
	begin
		if (btn1_debounce >= 6'd20)
		begin
			// Subroutine for BTN2 being pressed
			shift_counter <= shift_counter > 3'd0 ? shift_counter - 3'd1 : 3'd0; 
		end
				
		btn1_debounce <= 6'd0;
	end
end
endmodule

Declaring Peripheral

The following section shows the instruction to declare the peripherals and modules such as GPIO/GPIO Bus, internal oscillator and Phase Locked Loop (PLL).

Importing from Existing XML File

We've prepared a XML file to declare necessary GPIO and peripherals for FireAnt. Download counter.peri.xml. To import existing xml file counter.peri.xml, simply copy the file to the project folder. (i.e. $EFINITY_HOME/project/<custom_project>/). Efinity Software will read and modify the XML file for the project when Efinity Interface Designer started from graphical interface of IDE.

Note that editing the XML file is an advanced method to declaring peripherals. Any incorrect declaration will lead to synthesize failure. We import from existing XML file in this example because of ease of demonstration. You are advised to create or modify these peripherals and modules in Efinity Interface Designer only. For further details, please refer to Trion Interface User Guide.

Step 1

Copy counter.peri.xml from your download directory to the project folder. importing-from-existing-xml-file-step1-1

Step 2

In Efinity Software GUI, start Interface Designer. importing-from-existing-xml-file-step2-1

Step 3

3.1 Click Check Design importing-from-existing-xml-file-step3-1

3.2 Click Generate Efinity Constraint Files importing-from-existing-xml-file-step3-2

3.3 Click Generate Report importing-from-existing-xml-file-step3-3

Close Efinity Interface Designer if not issue found.

There is a generic peripheral xml file FireAnt.peri.xml which specify all available modules in Resource zone. Please note that over-specifying redundant peripheral/GPIOs will cause synthesis failure. When using the FireAnt.peri.xml, you have to manually erase peripherals that are not used. You are advised to create or modify these peripherals and modules in Efinity Interface Designer for your own purpose.

Automated Flow to Generate Bitstream

After writing the HDL and before generating bitstream, we have to synthesize our design and perform placement & routing. (We skip simulation to verify model behavior in this example). Efinity Software offers an automated flow control to run all process in 1-click. Just make sure the Toggle Automated button (top right hand corner of dashboard) is ON as below, then click the Synthesis (leftmost) button.

automated-flow-to-generate-bitstream-step1-1.png

The automated process takes around 1-2 minutes (depending on design). When the process completed, a green tick appears on top right hand corner of corresponding button. If the process failed, a red cross will show up.

automated-flow-to-generate-bitstream-step1-2.png

The generated bitstream file is stored in $EFINITY_HOME/project/counter/outflow/counter.hex.

Using Efinity Programmer

Follow the instruction in Programming Device guide to download the bitstream onto FireAnt.

Resource

Examples in compressed folder below consist of both source code and hex bitstream.

Activity Log

  • May 10, 2019 - Initial Release
⚠️ **GitHub.com Fallback** ⚠️