|
6 | 6 | 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. |
7 | 7 |
|
8 | 8 | 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. |
10 | 10 |
|
11 | 11 | ## Usage |
12 | 12 |
|
@@ -36,6 +36,26 @@ sudo install -D --strip bazel-bin/fpga/fpga-as /usr/local/bin/fpga-as |
36 | 36 |
|
37 | 37 | # How it works |
38 | 38 |
|
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: |
40 | 46 |
|
41 | 47 |  |
| 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