Skip to content

Commit

Permalink
EnigmaX1 hardware
Browse files Browse the repository at this point in the history
  • Loading branch information
ufrisk committed Jan 1, 2022
1 parent 424022b commit 23952f7
Show file tree
Hide file tree
Showing 33 changed files with 11,440 additions and 17 deletions.
57 changes: 57 additions & 0 deletions EnigmaX1/build.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
PCILeech Enigma x1 Build
=================
This readme details some customizations that are possible to perform prior to building/flashing the FPGA. For general information please check out the general [readme](readme.md).

Building:
=================
1) Install Xilinx Vivado WebPACK 2020.2 or later.
2) Open Vivado Tcl Shell command prompt.
3) cd into the EnigmaX1 directory of the cloned or unpacked code (forward slash instead of backslash in path).
4) Run `source vivado_generate_project.tcl -notrace` to generate required project files.
5) Run `source vivado_build.tcl -notrace` to generate Xilinx proprietary IP cores and build bitstream.
6) Finished !!!

Building the project may take a very long time (~1 hour). Sometimes the build will fail if the directory path is too long. If build fails try re-run it while pcileech-fpga is placed in C:\Temp or any other place with short directory path.

The PCIe device will show as Xilinx Ethernet Adapter with Device ID 0x0666 on the target system by default. For instructions how to change the device id and other advanced build properties check out the section below for information.

Customizing PCIe device type, vendor ID and product ID:
=================
Please note that many combinations of device types, vendor IDs and product IDs will make computers not boot, hang and otherwise perform badly when the PCIe device is connected. If that happens please try another combination of values.

Please also note that changing the device and vendor ID is not in itself sufficient to make the device "undetectable" by software looking for malicious DMA devices. There are, more settings that are or aren't, directly modifiable in the PCIe configuration wizard that will alter the device PCIe configuration space.

* Please first generate the initial project as outlined in points 1-4 above.
* Open the project in Vivado Web Pack 2020.2 or later by double clicking on `pcileech_enigma_x1.xpr` in the generated pcileech_enigma_x1 sub-folder.
* In the PROJECT MANAGER - EnigmaX1 window expand: Design Sources > pcileech_enigma_x1_top > i_pcileech_pcie_a7.
* Double click on i_pcie_7x_0 shown in the expanded hierarchy from above to open the PCIe core designer GUI.
* Navigate to the IDs tab. Alter ID Initial Values and Class Code to custom values.
* (Optionally navigate to the BARs tab and alter the Bar0 Enabled memory values currently set to 4kB. It is not recommended to disable or go lower than 4kB).
* Click OK to save the changes to the PCIe core. Click Generate in the following dialogue.
* After the PCIe core is rebuilt - exit Vivado and resume building of the project from point 5 in the Building section above. (Optionally one may keep Vivado open and build the project by clicking on Generate Bitstream in the lower left instead).


#### Device Serial Number (DSN):

It may also be a good idea to modify the device serial number (DSN) by editing the line below in the file: `src/pcileech_pcie_cfg_a7.sv`
```verilog
rw[127:64] <= 64'h0000000101000A35; // cfg_dsn
```


#### Configuration Space:

It's possible to partly change the PCIe configuration space of the device. This is achieved by altering the value below from `1'b1` to `1'b0` in the file `src/pcileech_fifo.sv` (please see below). The PCIe configuration space is configured by editing the file `ip/pcileech_cfgspace.coe`. Please note that the Xilinx PCIe core will in-part override user-configured values.

in `src/pcileech_fifo.sv` change:
```verilog
rw[203] <= 1'b1; // CFGTLP ZERO DATA
```
into:
```verilog
rw[203] <= 1'b0; // CUSTOM CONFIGURATION SPACE ENABLED
```

It's not currently possible to read the custom configuration space from within PCILeech, but on a Linux system it's possible to view it using the `lspci` command. The command line, if the vendor/device id is the default 10ee:0666, is:

Linux lspci command line: `lspci -d 10ee:0666 -xxxx`.
334 changes: 334 additions & 0 deletions EnigmaX1/ip/bram_pcie_cfgspace.xci

Large diffs are not rendered by default.

583 changes: 583 additions & 0 deletions EnigmaX1/ip/fifo_256_32_clk2_comtx.xci

Large diffs are not rendered by default.

583 changes: 583 additions & 0 deletions EnigmaX1/ip/fifo_32_32_clk1_comtx.xci

Large diffs are not rendered by default.

578 changes: 578 additions & 0 deletions EnigmaX1/ip/fifo_32_32_clk2.xci

Large diffs are not rendered by default.

578 changes: 578 additions & 0 deletions EnigmaX1/ip/fifo_34_34.xci

Large diffs are not rendered by default.

582 changes: 582 additions & 0 deletions EnigmaX1/ip/fifo_41_41_clk2_tlptapcfgspace.xci

Large diffs are not rendered by default.

580 changes: 580 additions & 0 deletions EnigmaX1/ip/fifo_55_55_clk2_tlptapcfgspace.xci

Large diffs are not rendered by default.

581 changes: 581 additions & 0 deletions EnigmaX1/ip/fifo_64_64.xci

Large diffs are not rendered by default.

577 changes: 577 additions & 0 deletions EnigmaX1/ip/fifo_64_64_clk1_fifocmd.xci

Large diffs are not rendered by default.

580 changes: 580 additions & 0 deletions EnigmaX1/ip/fifo_64_64_clk2_comrx.xci

Large diffs are not rendered by default.

583 changes: 583 additions & 0 deletions EnigmaX1/ip/fifo_66_66.xci

Large diffs are not rendered by default.

584 changes: 584 additions & 0 deletions EnigmaX1/ip/fifo_68_34.xci

Large diffs are not rendered by default.

614 changes: 614 additions & 0 deletions EnigmaX1/ip/pcie_7x_0.xci

Large diffs are not rendered by default.

280 changes: 280 additions & 0 deletions EnigmaX1/ip/pcileech_cfgspace.coe
Original file line number Diff line number Diff line change
@@ -0,0 +1,280 @@
memory_initialization_radix=16;
memory_initialization_vector=

fffff000,fffff004,fffff008,fffff00c,
fffff010,fffff014,fffff018,fffff01c,
fffff020,fffff024,fffff028,fffff02c,
fffff030,fffff034,fffff038,fffff03c,
fffff040,fffff044,fffff048,fffff04c,
fffff050,fffff054,fffff058,fffff05c,
fffff060,fffff064,fffff068,fffff06c,
fffff070,fffff074,fffff078,fffff07c,
fffff080,fffff084,fffff088,fffff08c,
fffff090,fffff094,fffff098,fffff09c,
fffff0a0,fffff0a4,fffff0a8,fffff0ac,
fffff0b0,fffff0b4,fffff0b8,fffff0bc,
fffff0c0,fffff0c4,fffff0c8,fffff0cc,
fffff0d0,fffff0d4,fffff0d8,fffff0dc,
fffff0e0,fffff0e4,fffff0e8,fffff0ec,
fffff0f0,fffff0f4,fffff0f8,fffff0fc,

fffff100,fffff104,fffff108,fffff10c,
fffff110,fffff114,fffff118,fffff11c,
fffff120,fffff124,fffff128,fffff12c,
fffff130,fffff134,fffff138,fffff13c,
fffff140,fffff144,fffff148,fffff14c,
fffff150,fffff154,fffff158,fffff15c,
fffff160,fffff164,fffff168,fffff16c,
fffff170,fffff174,fffff178,fffff17c,
fffff180,fffff184,fffff188,fffff18c,
fffff190,fffff194,fffff198,fffff19c,
fffff1a0,fffff1a4,fffff1a8,fffff1ac,
fffff1b0,fffff1b4,fffff1b8,fffff1bc,
fffff1c0,fffff1c4,fffff1c8,fffff1cc,
fffff1d0,fffff1d4,fffff1d8,fffff1dc,
fffff1e0,fffff1e4,fffff1e8,fffff1ec,
fffff1f0,fffff1f4,fffff1f8,fffff1fc,

fffff200,fffff204,fffff208,fffff20c,
fffff210,fffff214,fffff218,fffff21c,
fffff220,fffff224,fffff228,fffff22c,
fffff230,fffff234,fffff238,fffff23c,
fffff240,fffff244,fffff248,fffff24c,
fffff250,fffff254,fffff258,fffff25c,
fffff260,fffff264,fffff268,fffff26c,
fffff270,fffff274,fffff278,fffff27c,
fffff280,fffff284,fffff288,fffff28c,
fffff290,fffff294,fffff298,fffff29c,
fffff2a0,fffff2a4,fffff2a8,fffff2ac,
fffff2b0,fffff2b4,fffff2b8,fffff2bc,
fffff2c0,fffff2c4,fffff2c8,fffff2cc,
fffff2d0,fffff2d4,fffff2d8,fffff2dc,
fffff2e0,fffff2e4,fffff2e8,fffff2ec,
fffff2f0,fffff2f4,fffff2f8,fffff2fc,

fffff300,fffff304,fffff308,fffff30c,
fffff310,fffff314,fffff318,fffff31c,
fffff320,fffff324,fffff328,fffff32c,
fffff330,fffff334,fffff338,fffff33c,
fffff340,fffff344,fffff348,fffff34c,
fffff350,fffff354,fffff358,fffff35c,
fffff360,fffff364,fffff368,fffff36c,
fffff370,fffff374,fffff378,fffff37c,
fffff380,fffff384,fffff388,fffff38c,
fffff390,fffff394,fffff398,fffff39c,
fffff3a0,fffff3a4,fffff3a8,fffff3ac,
fffff3b0,fffff3b4,fffff3b8,fffff3bc,
fffff3c0,fffff3c4,fffff3c8,fffff3cc,
fffff3d0,fffff3d4,fffff3d8,fffff3dc,
fffff3e0,fffff3e4,fffff3e8,fffff3ec,
fffff3f0,fffff3f4,fffff3f8,fffff3fc,



fffff400,fffff404,fffff408,fffff40c,
fffff410,fffff414,fffff418,fffff41c,
fffff420,fffff424,fffff428,fffff42c,
fffff430,fffff434,fffff438,fffff43c,
fffff440,fffff444,fffff448,fffff44c,
fffff450,fffff454,fffff458,fffff45c,
fffff460,fffff464,fffff468,fffff46c,
fffff470,fffff474,fffff478,fffff47c,
fffff480,fffff484,fffff488,fffff48c,
fffff490,fffff494,fffff498,fffff49c,
fffff4a0,fffff4a4,fffff4a8,fffff4ac,
fffff4b0,fffff4b4,fffff4b8,fffff4bc,
fffff4c0,fffff4c4,fffff4c8,fffff4cc,
fffff4d0,fffff4d4,fffff4d8,fffff4dc,
fffff4e0,fffff4e4,fffff4e8,fffff4ec,
fffff4f0,fffff4f4,fffff4f8,fffff4fc,

fffff500,fffff504,fffff508,fffff50c,
fffff510,fffff514,fffff518,fffff51c,
fffff520,fffff524,fffff528,fffff52c,
fffff530,fffff534,fffff538,fffff53c,
fffff540,fffff544,fffff548,fffff54c,
fffff550,fffff554,fffff558,fffff55c,
fffff560,fffff564,fffff568,fffff56c,
fffff570,fffff574,fffff578,fffff57c,
fffff580,fffff584,fffff588,fffff58c,
fffff590,fffff594,fffff598,fffff59c,
fffff5a0,fffff5a4,fffff5a8,fffff5ac,
fffff5b0,fffff5b4,fffff5b8,fffff5bc,
fffff5c0,fffff5c4,fffff5c8,fffff5cc,
fffff5d0,fffff5d4,fffff5d8,fffff5dc,
fffff5e0,fffff5e4,fffff5e8,fffff5ec,
fffff5f0,fffff5f4,fffff5f8,fffff5fc,

fffff600,fffff604,fffff608,fffff60c,
fffff610,fffff614,fffff618,fffff61c,
fffff620,fffff624,fffff628,fffff62c,
fffff630,fffff634,fffff638,fffff63c,
fffff640,fffff644,fffff648,fffff64c,
fffff650,fffff654,fffff658,fffff65c,
fffff660,fffff664,fffff668,fffff66c,
fffff670,fffff674,fffff678,fffff67c,
fffff680,fffff684,fffff688,fffff68c,
fffff690,fffff694,fffff698,fffff69c,
fffff6a0,fffff6a4,fffff6a8,fffff6ac,
fffff6b0,fffff6b4,fffff6b8,fffff6bc,
fffff6c0,fffff6c4,fffff6c8,fffff6cc,
fffff6d0,fffff6d4,fffff6d8,fffff6dc,
fffff6e0,fffff6e4,fffff6e8,fffff6ec,
fffff6f0,fffff6f4,fffff6f8,fffff6fc,

fffff700,fffff704,fffff708,fffff70c,
fffff710,fffff714,fffff718,fffff71c,
fffff720,fffff724,fffff728,fffff72c,
fffff730,fffff734,fffff738,fffff73c,
fffff740,fffff744,fffff748,fffff74c,
fffff750,fffff754,fffff758,fffff75c,
fffff760,fffff764,fffff768,fffff76c,
fffff770,fffff774,fffff778,fffff77c,
fffff780,fffff784,fffff788,fffff78c,
fffff790,fffff794,fffff798,fffff79c,
fffff7a0,fffff7a4,fffff7a8,fffff7ac,
fffff7b0,fffff7b4,fffff7b8,fffff7bc,
fffff7c0,fffff7c4,fffff7c8,fffff7cc,
fffff7d0,fffff7d4,fffff7d8,fffff7dc,
fffff7e0,fffff7e4,fffff7e8,fffff7ec,
fffff7f0,fffff7f4,fffff7f8,fffff7fc,


fffff800,fffff804,fffff808,fffff80c,
fffff810,fffff814,fffff818,fffff81c,
fffff820,fffff824,fffff828,fffff82c,
fffff830,fffff834,fffff838,fffff83c,
fffff840,fffff844,fffff848,fffff84c,
fffff850,fffff854,fffff858,fffff85c,
fffff860,fffff864,fffff868,fffff86c,
fffff870,fffff874,fffff878,fffff87c,
fffff880,fffff884,fffff888,fffff88c,
fffff890,fffff894,fffff898,fffff89c,
fffff8a0,fffff8a4,fffff8a8,fffff8ac,
fffff8b0,fffff8b4,fffff8b8,fffff8bc,
fffff8c0,fffff8c4,fffff8c8,fffff8cc,
fffff8d0,fffff8d4,fffff8d8,fffff8dc,
fffff8e0,fffff8e4,fffff8e8,fffff8ec,
fffff8f0,fffff8f4,fffff8f8,fffff8fc,

fffff900,fffff904,fffff908,fffff90c,
fffff910,fffff914,fffff918,fffff91c,
fffff920,fffff924,fffff928,fffff92c,
fffff930,fffff934,fffff938,fffff93c,
fffff940,fffff944,fffff948,fffff94c,
fffff950,fffff954,fffff958,fffff95c,
fffff960,fffff964,fffff968,fffff96c,
fffff970,fffff974,fffff978,fffff97c,
fffff980,fffff984,fffff988,fffff98c,
fffff990,fffff994,fffff998,fffff99c,
fffff9a0,fffff9a4,fffff9a8,fffff9ac,
fffff9b0,fffff9b4,fffff9b8,fffff9bc,
fffff9c0,fffff9c4,fffff9c8,fffff9cc,
fffff9d0,fffff9d4,fffff9d8,fffff9dc,
fffff9e0,fffff9e4,fffff9e8,fffff9ec,
fffff9f0,fffff9f4,fffff9f8,fffff9fc,

fffffa00,fffffa04,fffffa08,fffffa0c,
fffffa10,fffffa14,fffffa18,fffffa1c,
fffffa20,fffffa24,fffffa28,fffffa2c,
fffffa30,fffffa34,fffffa38,fffffa3c,
fffffa40,fffffa44,fffffa48,fffffa4c,
fffffa50,fffffa54,fffffa58,fffffa5c,
fffffa60,fffffa64,fffffa68,fffffa6c,
fffffa70,fffffa74,fffffa78,fffffa7c,
fffffa80,fffffa84,fffffa88,fffffa8c,
fffffa90,fffffa94,fffffa98,fffffa9c,
fffffaa0,fffffaa4,fffffaa8,fffffaac,
fffffab0,fffffab4,fffffab8,fffffabc,
fffffac0,fffffac4,fffffac8,fffffacc,
fffffad0,fffffad4,fffffad8,fffffadc,
fffffae0,fffffae4,fffffae8,fffffaec,
fffffaf0,fffffaf4,fffffaf8,fffffafc,

fffffb00,fffffb04,fffffb08,fffffb0c,
fffffb10,fffffb14,fffffb18,fffffb1c,
fffffb20,fffffb24,fffffb28,fffffb2c,
fffffb30,fffffb34,fffffb38,fffffb3c,
fffffb40,fffffb44,fffffb48,fffffb4c,
fffffb50,fffffb54,fffffb58,fffffb5c,
fffffb60,fffffb64,fffffb68,fffffb6c,
fffffb70,fffffb74,fffffb78,fffffb7c,
fffffb80,fffffb84,fffffb88,fffffb8c,
fffffb90,fffffb94,fffffb98,fffffb9c,
fffffba0,fffffba4,fffffba8,fffffbac,
fffffbb0,fffffbb4,fffffbb8,fffffbbc,
fffffbc0,fffffbc4,fffffbc8,fffffbcc,
fffffbd0,fffffbd4,fffffbd8,fffffbdc,
fffffbe0,fffffbe4,fffffbe8,fffffbec,
fffffbf0,fffffbf4,fffffbf8,fffffbfc,



fffffc00,fffffc04,fffffc08,fffffc0c,
fffffc10,fffffc14,fffffc18,fffffc1c,
fffffc20,fffffc24,fffffc28,fffffc2c,
fffffc30,fffffc34,fffffc38,fffffc3c,
fffffc40,fffffc44,fffffc48,fffffc4c,
fffffc50,fffffc54,fffffc58,fffffc5c,
fffffc60,fffffc64,fffffc68,fffffc6c,
fffffc70,fffffc74,fffffc78,fffffc7c,
fffffc80,fffffc84,fffffc88,fffffc8c,
fffffc90,fffffc94,fffffc98,fffffc9c,
fffffca0,fffffca4,fffffca8,fffffcac,
fffffcb0,fffffcb4,fffffcb8,fffffcbc,
fffffcc0,fffffcc4,fffffcc8,fffffccc,
fffffcd0,fffffcd4,fffffcd8,fffffcdc,
fffffce0,fffffce4,fffffce8,fffffcec,
fffffcf0,fffffcf4,fffffcf8,fffffcfc,

fffffd00,fffffd04,fffffd08,fffffd0c,
fffffd10,fffffd14,fffffd18,fffffd1c,
fffffd20,fffffd24,fffffd28,fffffd2c,
fffffd30,fffffd34,fffffd38,fffffd3c,
fffffd40,fffffd44,fffffd48,fffffd4c,
fffffd50,fffffd54,fffffd58,fffffd5c,
fffffd60,fffffd64,fffffd68,fffffd6c,
fffffd70,fffffd74,fffffd78,fffffd7c,
fffffd80,fffffd84,fffffd88,fffffd8c,
fffffd90,fffffd94,fffffd98,fffffd9c,
fffffda0,fffffda4,fffffda8,fffffdac,
fffffdb0,fffffdb4,fffffdb8,fffffdbc,
fffffdc0,fffffdc4,fffffdc8,fffffdcc,
fffffdd0,fffffdd4,fffffdd8,fffffddc,
fffffde0,fffffde4,fffffde8,fffffdec,
fffffdf0,fffffdf4,fffffdf8,fffffdfc,

fffffe00,fffffe04,fffffe08,fffffe0c,
fffffe10,fffffe14,fffffe18,fffffe1c,
fffffe20,fffffe24,fffffe28,fffffe2c,
fffffe30,fffffe34,fffffe38,fffffe3c,
fffffe40,fffffe44,fffffe48,fffffe4c,
fffffe50,fffffe54,fffffe58,fffffe5c,
fffffe60,fffffe64,fffffe68,fffffe6c,
fffffe70,fffffe74,fffffe78,fffffe7c,
fffffe80,fffffe84,fffffe88,fffffe8c,
fffffe90,fffffe94,fffffe98,fffffe9c,
fffffea0,fffffea4,fffffea8,fffffeac,
fffffeb0,fffffeb4,fffffeb8,fffffebc,
fffffec0,fffffec4,fffffec8,fffffecc,
fffffed0,fffffed4,fffffed8,fffffedc,
fffffee0,fffffee4,fffffee8,fffffeec,
fffffef0,fffffef4,fffffef8,fffffefc,

ffffff00,ffffff04,ffffff08,ffffff0c,
ffffff10,ffffff14,ffffff18,ffffff1c,
ffffff20,ffffff24,ffffff28,ffffff2c,
ffffff30,ffffff34,ffffff38,ffffff3c,
ffffff40,ffffff44,ffffff48,ffffff4c,
ffffff50,ffffff54,ffffff58,ffffff5c,
ffffff60,ffffff64,ffffff68,ffffff6c,
ffffff70,ffffff74,ffffff78,ffffff7c,
ffffff80,ffffff84,ffffff88,ffffff8c,
ffffff90,ffffff94,ffffff98,ffffff9c,
ffffffa0,ffffffa4,ffffffa8,ffffffac,
ffffffb0,ffffffb4,ffffffb8,ffffffbc,
ffffffc0,ffffffc4,ffffffc8,ffffffcc,
ffffffd0,ffffffd4,ffffffd8,ffffffdc,
ffffffe0,ffffffe4,ffffffe8,ffffffec,
fffffff0,fffffff4,fffffff8,fffffffc
;
Loading

0 comments on commit 23952f7

Please sign in to comment.