Skip to content

Commit f1c002c

Browse files
committed
repo: add infographic of fasm2frames and a small description of the procedure
1 parent 2f77f24 commit f1c002c

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

README.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
This command-line tool converts [FASM][fasm-spec] files into bitstreams, simplifying the assembly of human-readable FPGA configurations into the binary formats needed to program various FPGAs.
77

88
At this stage, it can generate a set of frames in the same manner as [fasm2frames](https://github.com/chipsalliance/f4pga-xc-fasm/blob/25dc605c9c0896204f0c3425b52a332034cf5e5c/xc_fasm/fasm2frames.py).
9-
It has been tested with the Artix-7 [counter example][counter-example], where it produces identical frames—at approximately 10 times the speed.
9+
It has been tested with the Artix-7 [counter example][counter-example], where it produces identical frames—at approximately 10 times the speed compared to the pure Python textX based parser implementation.
1010

1111
## Usage
1212

@@ -36,6 +36,26 @@ sudo install -D --strip bazel-bin/fpga/fpga-as /usr/local/bin/fpga-as
3636

3737
# How it works
3838

39-
## Fasm To Frames
39+
## Frames generation
40+
41+
42+
In a FASM file, each line represents a sub-tile feature along with the configuration bits required to enable that feature.
43+
In other words, when a tile feature is enabled, its corresponding configuration bits must also be activated.
44+
45+
The diagram below illustrates the basic process for the `xc7a50t` fabric:
4046

4147
![fasm2frames](./img/fasm2frames.svg)
48+
49+
For example, consider the FASM line:
50+
```
51+
CLBLM_R_X33Y38.SLICEM_X0.ALUT.INIT[63:32]=32'b00000000000000000000000000000100
52+
```
53+
This line instructs the system to configure the SLICEM_X0.ALUT.INIT feature of the tile named CLBLM_R_X33Y38, enabling the feature at address 34.
54+
55+
The next step is to locate the tile metadata in the FPGA fabric's `tilegrid.json` file. The metadata provides essential information, including:
56+
57+
* tile_type: `"CLBLM_R"`
58+
* baseaddr: `"0x00401080`
59+
* offset: `77`
60+
61+
Using this metadata, you can search the segbits database for the specific feature. By matching the tile_type and the FASM feature name, you can identify the correct configuration bits in the tile type segbits file (`segbits_clblm_r.db`). In this case, you would look for the entry corresponding to CLBLM_R.SLICEM_X0.ALUT.INIT and find the entry for address `[34]`. The value 34_06 then provides the coordinates for the word index and the specific bit index to be set.

0 commit comments

Comments
 (0)