Skip to content

Commit

Permalink
Apply FPGA changes to fix AMDS counters
Browse files Browse the repository at this point in the history
Only trigger AMDS interface if enabled
Split timeout counters into byte timeouts and data timeouts
Rewrite some logic for generating waiting_for_first_fe and trigger_to_fe_timer
  • Loading branch information
codecubepi committed Aug 15, 2024
1 parent d67c98b commit 1f46462
Show file tree
Hide file tree
Showing 8 changed files with 779 additions and 713 deletions.
1,122 changes: 561 additions & 561 deletions hw/amdc_revf.bd

Large diffs are not rendered by default.

36 changes: 25 additions & 11 deletions ip_repo/amdc_amds_1.0/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ This IP has no build-time configuration parameters. It expects a 200 MHz clock i
| 0x14 | AMDS_ADC_CH6 | R | Raw ADC channel 6 data register |
| 0x18 | AMDS_ADC_CH7 | R | Raw ADC channel 7 data register |
| 0x1C | AMDS_ADC_CH8 | R | Raw ADC channel 8 data register |
| 0x20 | UNUSED1 | RW | Unused register |
| 0x24 | AMDS_CH_VALID | R | Channel Valid register |
| 0x28 | AMDS_COUNT_VALID | R | Number of valid data recieved over UART |
| 0x2C | AMDS_COUNT_CORRUPT | R | Number of corrupt data recieved over UART |
| 0x30 | AMDS_COUNT_TIMEOUT | R | Number of timeout data recieved over UART |
| 0x34 | UNUSED2 | RW | Unused register |
| 0x20 | AMDS_DELAY_TIMER | R | Trigger to data delay timer |
| 0x24 | AMDS_CH_VALID | R | Channel Valid register |
| 0x28 | AMDS_BYTES_VALID | R | Number of valid bytes received over UART |
| 0x2C | AMDS_BYTES_CORRUPT | R | Number of corrupt bytes received over UART |
| 0x30 | AMDS_BYTES_TIMED_OUT | R | Number of bytes timed out over UART |
| 0x34 | AMDS_DATA_TIMED_OUT | R | Number of data streams timed out over UART |
| 0x38 | UNUSED3 | RW | Unused register |
| 0x3C | UNUSED4 | RW | Unused register |

Expand All @@ -46,32 +46,46 @@ This IP has no build-time configuration parameters. It expects a 200 MHz clock i
| -- | -- | -- |
| 31:0 | DATA | Sign-extended, 2's complement, raw data from ADCs on AMDS daughtercards |

### Register: `AMDS_DELAY_TIMER`

| Bits | Name | Description |
| -- | -- | -- |
| 31:16 | TRIGGER_TO_EDGE1 | FPGA cycle count from the trigger to the first falling edge on data line 1 |
| 15:0 | TRIGGER_TO_EDGE0 | FPGA cycle count from the trigger to the first falling edge on data line 0 |

### Register: `AMDS_CH_VALID`

| Bits | Name | Description |
| -- | -- | -- |
| 7:0 | CH_VALID | Indicates that the raw ADC data contained in a channel's data register is valid. For example, bits[7:0] == '11001101' means that the data registers for channels 1, 3, 4, 7, and 8 contain valid data, while the data registers for channels 2, 5, and 6 contain invalid data |

### Register: `AMDS_COUNT_VALID`
### Register: `AMDS_BYTES_VALID`

| Bits | Name | Description |
| -- | -- | -- |
| 31:16 | VALID_RX1 | Unsigned count of valid bytes received over UART1 from AMDS |
| 15:0 | VALID_RX0 | Unsigned count of valid bytes received over UART0 from AMDS |

### Register: `AMDS_COUNT_CORRUPT`
### Register: `AMDS_BYTES_CORRUPT`

| Bits | Name | Description |
| -- | -- | -- |
| 31:16 | CORRUPT_RX1 | Unsigned count of corrupt bytes received over UART1 from AMDS |
| 15:0 | CORRUPT_RX0 | Unsigned count of corrupt bytes received over UART0 from AMDS |

### Register: `AMDS_COUNT_TIMEOUT`
### Register: `AMDS_BYTES_TIMED_OUT`

| Bits | Name | Description |
| -- | -- | -- |
| 31:16 | TIMEOUT_RX1 | Unsigned count of timed out bytes over UART1 from AMDS |
| 15:0 | TIMEOUT_RX0 | Unsigned count of timed out bytes over UART0 from AMDS |

### Register: `AMDS_DATA_TIMED_OUT`

| Bits | Name | Description |
| -- | -- | -- |
| 31:16 | TIMEOUT_RX1 | Unsigned count of timeout bytes received over UART1 from AMDS |
| 15:0 | TIMEOUT_RX0 | Unsigned count of timeout bytes received over UART0 from AMDS |
| 31:16 | TIMEOUT_RX1 | Unsigned count of timed out data streams over UART1 from AMDS |
| 15:0 | TIMEOUT_RX0 | Unsigned count of timed out data streams over UART0 from AMDS |

## Testing

Expand Down
43 changes: 38 additions & 5 deletions ip_repo/amdc_amds_1.0/component.xml
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@
<spirit:parameters>
<spirit:parameter>
<spirit:name>viewChecksum</spirit:name>
<spirit:value>8cdaa683</spirit:value>
<spirit:value>99650e73</spirit:value>
</spirit:parameter>
</spirit:parameters>
</spirit:view>
Expand All @@ -282,7 +282,7 @@
<spirit:parameters>
<spirit:parameter>
<spirit:name>viewChecksum</spirit:name>
<spirit:value>8cdaa683</spirit:value>
<spirit:value>99650e73</spirit:value>
</spirit:parameter>
</spirit:parameters>
</spirit:view>
Expand Down Expand Up @@ -895,8 +895,8 @@
<xilinx:taxonomy>AXI_Peripheral</xilinx:taxonomy>
</xilinx:taxonomies>
<xilinx:displayName>amdc_amds_v1.0</xilinx:displayName>
<xilinx:coreRevision>11</xilinx:coreRevision>
<xilinx:coreCreationDateTime>2024-05-30T23:51:36Z</xilinx:coreCreationDateTime>
<xilinx:coreRevision>15</xilinx:coreRevision>
<xilinx:coreCreationDateTime>2024-08-13T19:26:58Z</xilinx:coreCreationDateTime>
<xilinx:tags>
<xilinx:tag xilinx:name="ui.data.coregen.dd@b6a820a_ARCHIVE_LOCATION">s:/School/WEMPEC/firmware-amds/ip_repo/amdc_amds_1.0</xilinx:tag>
<xilinx:tag xilinx:name="ui.data.coregen.dd@1dc30708_ARCHIVE_LOCATION">s:/School/WEMPEC/firmware-amds/ip_repo/amdc_amds_1.0</xilinx:tag>
Expand Down Expand Up @@ -1009,13 +1009,46 @@
<xilinx:tag xilinx:name="ui.data.coregen.dd@3b15c32d_ARCHIVE_LOCATION">s:/School/WEMPEC/firmware-amds/ip_repo/amdc_amds_1.0</xilinx:tag>
<xilinx:tag xilinx:name="ui.data.coregen.dd@2d200b92_ARCHIVE_LOCATION">s:/School/WEMPEC/firmware-amds/ip_repo/amdc_amds_1.0</xilinx:tag>
<xilinx:tag xilinx:name="ui.data.coregen.dd@7e0eeac7_ARCHIVE_LOCATION">s:/School/WEMPEC/firmware-amds/ip_repo/amdc_amds_1.0</xilinx:tag>
<xilinx:tag xilinx:name="ui.data.coregen.dd@34641678_ARCHIVE_LOCATION">s:/School/WEMPEC/firmware-amds/ip_repo/amdc_amds_1.0</xilinx:tag>
<xilinx:tag xilinx:name="ui.data.coregen.dd@2573c29a_ARCHIVE_LOCATION">s:/School/WEMPEC/firmware-amds/ip_repo/amdc_amds_1.0</xilinx:tag>
<xilinx:tag xilinx:name="ui.data.coregen.dd@382d6c90_ARCHIVE_LOCATION">s:/School/WEMPEC/firmware-amds/ip_repo/amdc_amds_1.0</xilinx:tag>
<xilinx:tag xilinx:name="ui.data.coregen.dd@2be9cb12_ARCHIVE_LOCATION">s:/School/WEMPEC/firmware-amds/ip_repo/amdc_amds_1.0</xilinx:tag>
<xilinx:tag xilinx:name="ui.data.coregen.dd@4ab936eb_ARCHIVE_LOCATION">s:/School/WEMPEC/firmware-amds/ip_repo/amdc_amds_1.0</xilinx:tag>
<xilinx:tag xilinx:name="ui.data.coregen.dd@c4c23e8_ARCHIVE_LOCATION">s:/School/WEMPEC/firmware-amds/ip_repo/amdc_amds_1.0</xilinx:tag>
<xilinx:tag xilinx:name="ui.data.coregen.dd@d4b3a1a_ARCHIVE_LOCATION">s:/School/WEMPEC/firmware-amds/ip_repo/amdc_amds_1.0</xilinx:tag>
<xilinx:tag xilinx:name="ui.data.coregen.dd@6bf12119_ARCHIVE_LOCATION">s:/School/WEMPEC/firmware-amds/ip_repo/amdc_amds_1.0</xilinx:tag>
<xilinx:tag xilinx:name="ui.data.coregen.dd@4e1758ca_ARCHIVE_LOCATION">s:/School/WEMPEC/firmware-amds/ip_repo/amdc_amds_1.0</xilinx:tag>
<xilinx:tag xilinx:name="ui.data.coregen.dd@55e9ba21_ARCHIVE_LOCATION">s:/School/WEMPEC/firmware-amds/ip_repo/amdc_amds_1.0</xilinx:tag>
<xilinx:tag xilinx:name="ui.data.coregen.dd@3600a4a3_ARCHIVE_LOCATION">s:/School/WEMPEC/firmware-amds/ip_repo/amdc_amds_1.0</xilinx:tag>
<xilinx:tag xilinx:name="ui.data.coregen.dd@57f574af_ARCHIVE_LOCATION">s:/School/WEMPEC/firmware-amds/ip_repo/amdc_amds_1.0</xilinx:tag>
<xilinx:tag xilinx:name="ui.data.coregen.dd@2330385c_ARCHIVE_LOCATION">s:/School/WEMPEC/firmware-amds/ip_repo/amdc_amds_1.0</xilinx:tag>
<xilinx:tag xilinx:name="ui.data.coregen.dd@13074f9c_ARCHIVE_LOCATION">s:/School/WEMPEC/firmware-amds/ip_repo/amdc_amds_1.0</xilinx:tag>
<xilinx:tag xilinx:name="ui.data.coregen.dd@26e94993_ARCHIVE_LOCATION">s:/School/WEMPEC/firmware-amds/ip_repo/amdc_amds_1.0</xilinx:tag>
<xilinx:tag xilinx:name="ui.data.coregen.dd@4591d9e6_ARCHIVE_LOCATION">s:/School/WEMPEC/firmware-amds/ip_repo/amdc_amds_1.0</xilinx:tag>
<xilinx:tag xilinx:name="ui.data.coregen.dd@319aa6c5_ARCHIVE_LOCATION">s:/School/WEMPEC/firmware-amds/ip_repo/amdc_amds_1.0</xilinx:tag>
<xilinx:tag xilinx:name="ui.data.coregen.dd@639cb480_ARCHIVE_LOCATION">s:/School/WEMPEC/firmware-amds/ip_repo/amdc_amds_1.0</xilinx:tag>
<xilinx:tag xilinx:name="ui.data.coregen.dd@6b4a427b_ARCHIVE_LOCATION">s:/School/WEMPEC/firmware-amds/ip_repo/amdc_amds_1.0</xilinx:tag>
<xilinx:tag xilinx:name="ui.data.coregen.dd@1ffbd786_ARCHIVE_LOCATION">s:/School/WEMPEC/firmware-amds/ip_repo/amdc_amds_1.0</xilinx:tag>
<xilinx:tag xilinx:name="ui.data.coregen.dd@4a514156_ARCHIVE_LOCATION">s:/School/WEMPEC/firmware-amds/ip_repo/amdc_amds_1.0</xilinx:tag>
<xilinx:tag xilinx:name="ui.data.coregen.dd@30e89b40_ARCHIVE_LOCATION">s:/School/WEMPEC/firmware-amds/ip_repo/amdc_amds_1.0</xilinx:tag>
<xilinx:tag xilinx:name="ui.data.coregen.dd@538f5928_ARCHIVE_LOCATION">s:/School/WEMPEC/firmware-amds/ip_repo/amdc_amds_1.0</xilinx:tag>
<xilinx:tag xilinx:name="ui.data.coregen.dd@722c96a8_ARCHIVE_LOCATION">s:/School/WEMPEC/firmware-amds/ip_repo/amdc_amds_1.0</xilinx:tag>
<xilinx:tag xilinx:name="ui.data.coregen.dd@107563d6_ARCHIVE_LOCATION">s:/School/WEMPEC/firmware-amds/ip_repo/amdc_amds_1.0</xilinx:tag>
<xilinx:tag xilinx:name="ui.data.coregen.dd@1a98e1ea_ARCHIVE_LOCATION">s:/School/WEMPEC/firmware-amds/ip_repo/amdc_amds_1.0</xilinx:tag>
<xilinx:tag xilinx:name="ui.data.coregen.dd@45af3fb_ARCHIVE_LOCATION">s:/School/WEMPEC/firmware-amds/ip_repo/amdc_amds_1.0</xilinx:tag>
<xilinx:tag xilinx:name="ui.data.coregen.dd@968a9cf_ARCHIVE_LOCATION">s:/School/WEMPEC/firmware-amds/ip_repo/amdc_amds_1.0</xilinx:tag>
<xilinx:tag xilinx:name="ui.data.coregen.dd@7ed4f408_ARCHIVE_LOCATION">s:/School/WEMPEC/firmware-amds/ip_repo/amdc_amds_1.0</xilinx:tag>
<xilinx:tag xilinx:name="ui.data.coregen.dd@3116430a_ARCHIVE_LOCATION">s:/School/WEMPEC/firmware-amds/ip_repo/amdc_amds_1.0</xilinx:tag>
<xilinx:tag xilinx:name="ui.data.coregen.dd@191e88ef_ARCHIVE_LOCATION">s:/School/WEMPEC/firmware-amds/ip_repo/amdc_amds_1.0</xilinx:tag>
<xilinx:tag xilinx:name="ui.data.coregen.dd@7094277a_ARCHIVE_LOCATION">s:/School/WEMPEC/firmware-amds/ip_repo/amdc_amds_1.0</xilinx:tag>
<xilinx:tag xilinx:name="ui.data.coregen.dd@365bc4f6_ARCHIVE_LOCATION">s:/School/WEMPEC/firmware-amds/ip_repo/amdc_amds_1.0</xilinx:tag>
</xilinx:tags>
</xilinx:coreExtensions>
<xilinx:packagingInfo>
<xilinx:xilinxVersion>2019.1</xilinx:xilinxVersion>
<xilinx:checksum xilinx:scope="busInterfaces" xilinx:value="addc58e4"/>
<xilinx:checksum xilinx:scope="memoryMaps" xilinx:value="ed1368d5"/>
<xilinx:checksum xilinx:scope="fileGroups" xilinx:value="d90fe025"/>
<xilinx:checksum xilinx:scope="fileGroups" xilinx:value="5b060784"/>
<xilinx:checksum xilinx:scope="ports" xilinx:value="206c29dc"/>
<xilinx:checksum xilinx:scope="hdlParameters" xilinx:value="e7b50784"/>
<xilinx:checksum xilinx:scope="parameters" xilinx:value="0048a12a"/>
Expand Down
Loading

0 comments on commit 1f46462

Please sign in to comment.