Difference between revisions of "FPGA Programmer"

From UConn PAN
Jump to navigation Jump to search
m
 
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
== (110) Program DAC ==
+
== (110) DAC Programmer ==
  
This block will have a substate to obtain the programming mask.  It then loops 32 (or 24 or 16) times on a second substate that obtains the next programming value and, if the corresponding mask bit is high, programs that channel of the DAC. A mux may be needed to select the appropriate bit from the programming mask.  It also updates the locally stored DAC channel values (which may be stored on the FPGA, the CP2200/1 Flash, or other) in preparation for a "D" response packet.  Then it transitions to state 111.
+
The DAC Programmer assigns DAC voltages according to the mask and values listed in the P-packet payload. The module always passes control to the Transmitter to send a D-packet, confirming the requested values.
  
inputs
+
The mask selects which channels must be altered. Any channel that is to be reprogrammed will have a 1 in the corresponding location, and any channel that is to be left alone will have a 0 in the corresponding location.  The MSB of the first byte will be channel 0  and the LSB of the fourth byte will be channel 31.  Thus, if only channels 5 through 17 are to be programmed, the mask would contain:
* ''Clk'': clock
+
{| align="center" cellpadding="4" border="0" cellspacing="0" style="text-align:left"
* ''/Rst'': asynchronous, active-low reset
+
! First data byte
* ''State'': 3-bit state value
+
| 0 || 0 || 0 || 0 || 0 || 1 || 1 || 1
 +
|-
 +
! Second data byte
 +
| 1 || 1 || 1 || 1 || 1 || 1 || 1 || 1
 +
|-
 +
! Third data byte
 +
| 1 || 1 || 0 || 0 || 0 || 0 || 0 || 0
 +
|-
 +
! Fourth data byte
 +
| 0 || 0 || 0 || 0 || 0 || 0 || 0 || 0
 +
|}
  
internal signals
+
== Programming Details ==
* ''S_En'': state enable, ''S_En'' <= not (''St(2)'' or ''St(1)'' or ''St(0)'')
 
* ''Go'': when ''S_En'' goes high ''Go'' pulses for one cycle
 
  
blocks
+
[[Image:P-packetPayload.png|frame|P-packet Format]]
* '''Mask Fetcher'''
+
 
** This block reads the programming mask, contained in the second data byte (first remaining byte) through the 5th/4th/3rd byte (4th/3rd/2nd remaining byte), and saves it into a 32/24/16-bit register.
+
 
** inputs
+
The Programmer is one of the more complex modules. There are two stages involved in its process: mask and data. The first stage involves reading and storing the 4-byte mask (32-bits corresponding to 32 channels of the DAC), which follows immediately after the location and type bytes of the P-packet payload. Then the Programmer steps through the rest of the P-packet in 2-byte words, each containing the 14-bit DAC voltage, ordering write operations via the [[Programming_the_DAC|DAC Controller]] for each one. The packet is expected to have all 32 values in ascending order of channels. For any channels that need not be altered the mask must contain 0's for the corresponding bits. If a requested value exceeds the voltage level hardwired into the FPGA firmware, this maximum value is set instead of that requested by in the P-packet. The responding D-packet will reflect this correction.
*** ''Clk'': clock
+
 
*** ''/Rst'': asynchronous, active-low reset
+
The [[FPGA_Registers#DAC Register|DAC Register]] is pulsed simultaneously with the DAC controller to record the programmed value. These will later be sent back to the PC for confirmation. (No feedback from the DAC chip itself is possible. Channel 31 is reserved for calibration and is connected to ADC channel 7.) Because the combined duration of these operations exceeds the reception time of the minimum-length packet, the module inhibits the Receiver Interface of the Ethernet Controller for the duration of the programming to prevent incoming packet pileup and receive buffer overload.
*** ''Go'': pulse to begin, comes from ''Go'' internal signal of block 110
+
 
*** ''TxRx_D'': 8-bit data bus from transceiver
+
 
*** ''TxRx_Done'': ''Done'' signal from transceiver
+
=== Ports ===
** outputs
+
 
*** ''TxRx_Go'': ''Go'' input on transceiver
+
* ''Clk'': [in] clock
*** ''TxRx_R/W'': ''R/W'' input on transceiver; tied to read (one)
+
* ''Rst'': [in] asynchronous reset
*** ''TxRx_A'': ''A_in'' bus on transceiver
+
 
*** ''Mask'': 32/24/16-bit readout of programming mask
+
 
*** ''Done'': pulse to signal that mask has been obtained
+
Write signals to the [[Programming_the_DAC|DAC Controller]] and [[FPGA_Registers#DAC Register|DAC Register]]
* '''Programmer'''
+
* ''DAC_iGo'': [out] active-low "Go" signal
** Programs the DAC. Loops 32/24/16 times, obtaining the next byte from the CP2200/1 buffer, checking the mask, programming the DAC if the mask is 1 or skipping if the mask is 0.  Also writes the value to the internal DAC value storage registers (or Flash memory or other).
+
* ''DACReg_En'': Enable (write) signal to DAC Register
** inputs
+
* ''DAC_Addr'': [out] 5-bit DAC channel address
*** ''Clk'': clock
+
* ''DAC_D'': [out] 14-bit voltage value for the register and DAC Controller
*** ''/Rst'': asynchronous, active-low reset
+
* ''DAC_Done'': [in] "Done programming" signal from DAC controller
*** ''Go'': pulse to begin; feeds from ''Done'' signal of Mask Fetcher
+
 
*** ''TxRx_D'': ''D_out'' bus on transceiver
+
 
*** ''TxRx_Done'': ''Done'' signal on transceiver
+
[[FPGA_Registers#State_Register|State Register]] Control Lines
** outputs
+
* ''state_En'': [out] state register enable (write) signal
*** - DAC control lines -
+
* ''state_D'': [out] (3-bit) state register input
*** ''TxRx_Go'': ''Go'' signal on transceiver
+
* ''state_Q'': [in] (3-bit) state register output
*** ''TxRx_R/W'': ''R/W'' signal on transceiver
+
 
*** ''TxRx_A'': ''A_in'' bus on transceiver
+
 
*** ''Sel'': 5/5/4-bit select bus to internal registers
+
[[FPGA_Transceiver|Transceiver]] Control Lines
*** ''Data'': 32/24/16-bit data bus to internal registers
+
* ''TxRx_Go'': [out] "Go" signal to read/write an EC control register byte
*** ''Done'': pulse to signal completion
+
* ''TxRx_RiW'': [out] active-high read, active-low write flag
* '''Discarder'''
+
* ''TxRx_Aout'': [out] EC control register address (8-bit)
** This block orders the CP2200/1 to discard the packet, now that the FPGA is done with all the data contained within the packet.
+
* ''TxRx_Din'': [in] EC control register return value
** inputs
+
* ''TxRx_Dout'': [out] EC control register write value
*** ''Clk'': clock
+
* ''TxRx_Done'': [in] "Done" signal from [[FPGA_Transceiver|Transceiver]]
*** ''/Rst'': asynchronous, active-low reset
 
*** ''Go'': pulse to begin; feeds from ''Done'' signal of Programmer
 
*** ''TxRx_Done'': ''Done'' signal on transceiver
 
** outputs
 
*** ''TxRx_Go'': ''Go'' signal on transceiver
 
*** ''TxRx_R/W'': ''R/W'' signal on transceiver
 
*** ''TxRx_A'': ''A_in'' bus on transceiver
 
*** ''Done'': pulse to signal completion
 
*** ''New_St'': next state to load into the state register; goes to 111 when ''Done'' is high
 

Latest revision as of 06:22, 5 November 2009

(110) DAC Programmer

The DAC Programmer assigns DAC voltages according to the mask and values listed in the P-packet payload. The module always passes control to the Transmitter to send a D-packet, confirming the requested values.

The mask selects which channels must be altered. Any channel that is to be reprogrammed will have a 1 in the corresponding location, and any channel that is to be left alone will have a 0 in the corresponding location. The MSB of the first byte will be channel 0 and the LSB of the fourth byte will be channel 31. Thus, if only channels 5 through 17 are to be programmed, the mask would contain:

First data byte 0 0 0 0 0 1 1 1
Second data byte 1 1 1 1 1 1 1 1
Third data byte 1 1 0 0 0 0 0 0
Fourth data byte 0 0 0 0 0 0 0 0

Programming Details

P-packet Format


The Programmer is one of the more complex modules. There are two stages involved in its process: mask and data. The first stage involves reading and storing the 4-byte mask (32-bits corresponding to 32 channels of the DAC), which follows immediately after the location and type bytes of the P-packet payload. Then the Programmer steps through the rest of the P-packet in 2-byte words, each containing the 14-bit DAC voltage, ordering write operations via the DAC Controller for each one. The packet is expected to have all 32 values in ascending order of channels. For any channels that need not be altered the mask must contain 0's for the corresponding bits. If a requested value exceeds the voltage level hardwired into the FPGA firmware, this maximum value is set instead of that requested by in the P-packet. The responding D-packet will reflect this correction.

The DAC Register is pulsed simultaneously with the DAC controller to record the programmed value. These will later be sent back to the PC for confirmation. (No feedback from the DAC chip itself is possible. Channel 31 is reserved for calibration and is connected to ADC channel 7.) Because the combined duration of these operations exceeds the reception time of the minimum-length packet, the module inhibits the Receiver Interface of the Ethernet Controller for the duration of the programming to prevent incoming packet pileup and receive buffer overload.


Ports

  • Clk: [in] clock
  • Rst: [in] asynchronous reset


Write signals to the DAC Controller and DAC Register

  • DAC_iGo: [out] active-low "Go" signal
  • DACReg_En: Enable (write) signal to DAC Register
  • DAC_Addr: [out] 5-bit DAC channel address
  • DAC_D: [out] 14-bit voltage value for the register and DAC Controller
  • DAC_Done: [in] "Done programming" signal from DAC controller


State Register Control Lines

  • state_En: [out] state register enable (write) signal
  • state_D: [out] (3-bit) state register input
  • state_Q: [in] (3-bit) state register output


Transceiver Control Lines

  • TxRx_Go: [out] "Go" signal to read/write an EC control register byte
  • TxRx_RiW: [out] active-high read, active-low write flag
  • TxRx_Aout: [out] EC control register address (8-bit)
  • TxRx_Din: [in] EC control register return value
  • TxRx_Dout: [out] EC control register write value
  • TxRx_Done: [in] "Done" signal from Transceiver