Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

fpgasm - FPGA Assembler opensource

Status
Not open for further replies.

stacksmith

Banned
Junior Member level 3
Joined
Sep 14, 2012
Messages
29
Helped
4
Reputation
8
Reaction score
4
Trophy points
1,283
Location
USA
Activity points
0
Introducing fpgasm - an free, opensource FPGA assembler. With 10 reserved words, you can grasp the syntax in minutes. You can design bare-metal circuits, no Verilog or VHDL.

For years I've been looking for a low-level tool, something like an 'assembler', that would let me manually control placement and wiring, and allow me full access to the FPGA substrate. I could not find it, so I wrote it. For a humorous look at how it came about see
https://www.fpgarelated.com/showarticle/39.php

For a one-page summary, go to
https://github.com/stacksmith/fpgasm/wiki/aaa.-Welcome-to-fpgasm!

I hope this tool will help our community and can't wait to see what you will do with it.

Victor Yurkovsky
 
Last edited:

How would you use it?
Could you paste a simple example of what syntax you would need to use to
implement (say) a NAND gate?
The examples on the web page only showed wiring from one pin to another, e.g.
Code:
//
Top() {
  button Buttons level:LVTTL; //pass on LVTTL to Buttons' level
  led Leds;
  wire button's OUT[0:3] to led's IN[0:3];
}
 
How would you use it?
Could you paste a simple example of what syntax you would need to use to
implement (say) a NAND gate? The examples on the web page only showed wiring from one pin to another
...
Very good. Wiring from one pin to another is a very important part of using fpgasm. To use a NAND gate, you would wire it in the same way. For instance, let's connect 2 buttons via a NAND gate to an led:
Code:
Top() {
  button Buttons;
  led Led0;
  nand Nand2 loc:xy(10,10); //Note that it has to be placed somewhere
  wire button's OUT[0:1] to nand's IN[0:1];  //nand gate inputs
  wire nand's OUT to led's IN;                    //and output
}
But I suspect your next question would be "But where does Nand2 come from?" There are many modules already defined in the "Spartan3" include file, but not Nand2. I suspect you want to see where the rubber meets the road, so instead of using LutG4 or something like that, let's go all the way down and create a definition of Nand2 using a built-in Spartan3 primitive SLICEL:
Code:
Nand2(loc) inputs(IN[2]), outputs(OUT){
  slice SLICEL loc:xy(0,0) cfg:{G:#LUT:D=~(A1*A2) GYMUX:G YUSED:0 };
  wire my IN[0] to his G1;
  wire my IN[1] to his G2;
  wire his Y to my OUT;
}
Here some of you will say "all that work for a 2-input NAND gate? Why would anyone bother?" You are right, but have you seen what "hello world" looks like in assembly language? This is a bit of a contrived example - our Nand2 module could represent two sets any logic equation with 4 inputs, with a mux connecting them, with 2 flip-flops, and carry logic at no extra cost - the fpga cell already has all that circuitry built in...In real life you would pack a bit more of custom logic, at least to fill the F lut...
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top