Skip to content

Commit b14ce2e

Browse files
authored
Merge pull request #18 from lromor/add-infographic
repo: add infographic to README.md
2 parents 1402a53 + f1c002c commit b14ce2e

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

README.md

Lines changed: 27 additions & 1 deletion
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

@@ -33,3 +33,29 @@ sudo install -D --strip bazel-bin/fpga/fpga-as /usr/local/bin/fpga-as
3333
[fasm-spec]: https://fasm.readthedocs.io/en/stable/#
3434
[bazel]: https://bazel.build/
3535
[counter-example]: https://github.com/chipsalliance/f4pga-examples/blob/13f11197b33dae1cde3bf146f317d63f0134eacf/xc7/counter_test/counter.v
36+
37+
# How it works
38+
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:
46+
47+
![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.

img/fasm2frames.svg

Lines changed: 3 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)