Difference between revisions of "FPGA Reset"

From UConn PAN
Jump to navigation Jump to search
m
 
m
 
(13 intermediate revisions by the same user not shown)
Line 1: Line 1:
== (000) Reset Cycle ==
+
:''See also [[Programming_the_Ethernet_controller|Programming the Ethernet Controller]]'' for a survey of modules and a general discussion of FPGA design approach.''
  
Block 000 will have four functional blocks: one each for the DAC, ADC, and Ethernet controller, and one to coordinate their completion.  The temperature sensor lacks an external reset function; it self-initializes on startup.  The "R" packet will supply flags as to whether or not to enable the various blocks.  A power-on reset will default to resetting all components.  Using the enable flags like a mask on the done lines, the fourth functional block will update the state register.  For information on the reset procedures, see [[Reset and Initialization]].
+
= (00X) Reset Modules =
  
inputs
+
The reset modules Reset_hard (000) and Reset_soft (001) coordinate various stages of the board reset. The former, analogous to the cold boot of a computer, performs the basic initial reset steps dealing mainly with the startup and configuration of the Ethernet Controller chip (EC). The latter module is a more customized second stage of full reset or just a soft reset that concerns the sensor and DAC chips. It also records the MAC address of the tagger-controlling PC for further communication. (This cannot be handled in the Reset_hard stage as all registers on the EC and FPGA are cleared and the PC's MAC address stamped on the hard reset packet (R-packet) cannot be saved)
* ''Clk'': clock
 
* ''/Rst'': asynchronous, active-low reset
 
* ''State'': 3-bit state value
 
* ''D_En'': DAC enable, assume held high/low by previous block
 
* ''A_En'': ADC enable, assume held high/low by previous block
 
* ''E_En'': Ethernet enable, assume held high/low by previous block
 
  
internal signals
+
The control packets type bytes leading to states 00X pertaining to these reset modules are:
* ''S_En'': state enable, ''S_En'' <= not (''St(2)'' or ''St(1)'' or ''St(0)'')
+
{| class="wikitable" border="1" align="center" style="text-align:center" cellspacing="0" cellpadding="4"
* ''Go'': when ''S_En'' goes high ''Go'' pulses for one cycle
+
! colspan="3" | Packet Type Byte || colspan="2" | Effect on the FPGA
* ''D_Go'': DAC reset go pulse, ''D_Go'' <= ''Go'' and ''D_En''
+
|-
* ''A_Go'': ADC reset go pulse, ''A_Go'' <= ''Go'' and ''A_En''
+
! Type || Hex || Bin || State || Description
* ''E_Go'': Ethernet reset go pulse, ''E_Go'' <= ''Go'' and ''E_En''
+
|-
 +
| R || 0x52 || 0101&nbsp;0010 || 000 || align="left" | "Reset_hard" instruction
 +
|-
 +
| "R'" || 0xD2 || '''1'''101&nbsp;0010 || 001 || align="left" | Essentially an 'R' byte with '1' in the MSB instructing the FPGA to enter a reset cycle of the soft kind.
 +
|}
  
blocks
+
Both Reset modules yield control to the Transmitter to deliver a status packet to the PC (state 101).
* '''DAC Reset'''
+
 
** Resets and initializes the DAC.
+
 
** inputs
+
== Programming Details of Rest_hard ==
*** ''Clk'': clock
+
 
*** ''/Rst'': asynchronous, active-low reset
+
The Reset_hard module is written essentially as a list of module instantiations that perform EC control register read and write operations. The instances are "daisy-chained" to maintain chronological order - a "Done" signal from a preceding module is a "Go" for the following. Occasionally this list of instances is punctuated with counters intended to produce the required wait times and other specialized modules.
*** ''D_Go'': go pulse to begin reset/initialization process
+
 
** outputs
+
Programming the MAC interface requires the use of these specialized modules because the interface has an internal set of 16-bit control registers which are accessed indirectly through the use of general EC control registers. (See manual for more details.) The extra read/write operations necessary to use these indirect registers have been aggregated into ''MACwrToAddr'' in order to make this complication transparent to the higher level modules. These and other modules have in turn been used to create the ''MACaddrLoad'' module, which is responsible for loading the EC's factory-designated MAC address (stored in EC's flash memory) the above-mentioned indirect registers. This module also records a copy of these values in the [[FPGA_Registers#MAC_Register|MAC Address Register]] of the FPGA for the purpose of writing future packets.
*** - All DAC reset/initialization control lines -
+
 
*** ''D_Done'': goes high when reset/initialization process is complete, falls on ''D_Go'' pulse
+
Among other special modules, the ''INTcatcher'' is used to listen for "Self-Initialization Complete" interrupt (mask 0100). The Reset_hard block has also been instrumented with a dbShort external signal that "shorts out" the waiting counters for debig purposes.  
* '''ADC Reset'''
+
 
** Resets and initializes the ADC.
+
 
** inputs
+
=== Ports ===
*** ''Clk'': clock
+
 
*** ''/Rst'': asynchronous, active-low reset
+
* ''Clk'': [in] clock
*** ''A_Go'': go pulse to begin reset/initialization process
+
 
** outputs
+
 
*** - All ADC reset/initialization control lines -
+
Reset Signals
*** ''A_Done'': goes high when reset/initialization process is complete, falls on ''A_Go'' pulse
+
* ''Rst: [in] asynchronous reset
* '''Ethernet Reset'''
+
* ''Eth_iRst'': [inout] EC active-low reset pin
** Resets and initializes the Ethernet controller.
+
* ''Eth_iINT'': [in] EC active-low interrupt signal
** inputs
+
 
*** ''Clk'': clock
+
 
*** ''/Rst'': asynchronous, active-low reset
+
[[FPGA_Registers#State_Register|State Register]] Control Lines
*** ''E_Go'': go pulse to begin reset/initialization process
+
* ''state_En'': [out] state register enable (write) signal
** outputs
+
* ''state_D'': [out] (3-bit) state register input
*** - All Ethernet reset/initialization control lines -
+
* ''state_Q'': [in] (3-bit) state register output
*** ''E_Done'': goes high when reset/initialization process is complete, falls on ''E_Go'' pulse
+
 
* '''Coordinator'''
+
 
** Coordinates the completion of each reset cycle and notifies other blocks that the reset process is complete.
+
[[FPGA_Registers#MAC_Address_Registers|MAC Address Register]] Control Lines
** inputs
+
* ''MACregs_En'': [out] register enable (write) signal
*** ''Clk'': clock
+
* ''MACregs_A'': [out] byte address (4-bit)
*** ''/Rst'': asynchronous, active-low reset
+
* ''MACregs_D'': [out] 8-bit input value
*** ''D_En'': high when DAC is to be reset
+
 
*** ''D_Done'': high when DAC is done resetting
+
 
*** ''A_En'': high when ADC is to be reset
+
[[FPGA_Transceiver|Transceiver]] Control Lines
*** ''A_Done'': high when ADC is done resetting
+
* ''TxRx_Go'': [out] "Go" signal to read/write an EC control register byte
*** ''E_En'': high when Ethernet controller is to be reset
+
* ''TxRx_Aout'': [out] EC control register address (8-bit)
*** ''E_Done'': high when Ethernet controller is done resetting
+
* ''TxRx_Dout'': [out] EC control register write value
** internal signals
+
* ''TxRx_RiW'': [out] active-high read, active-low write flag
*** ''Flag'' <= (''D_Done'' or not ''D_En'') and (''A_Done'' or not ''A_En'') and (''E_Done'' or not ''E_En'')
+
* ''TxRx_Din'': [in] EC control register return value
** outputs
+
* ''TxRx_Done'': [in] "Done" signal from [[FPGA_Transceiver|Transceiver]].
*** ''Done'': when ''Flag'' goes high, ''Done'' pulses for one cycle; connects to state register as an enable
+
 
*** ''New_St'': new state to be written to the state register; goes to 001 while ''Done'' is high
+
* ''dbShort'': [in] debug signal to bypass EC reset waiting periods
 +
 
 +
 
 +
== Programming Details of Rest_soft ==
 +
 
 +
Reset_soft works like a counter, triggering a "Go" signal for an ''AutoRd'' module instance. A write signal to the [[FPGA_Registers#MAC_Register|MAC Address Register]] is also triggered for the first six bytes (payload bytes three through eight) as these represent the MAC address of the PC. The following two bytes are the Debug Byte and Chip Reset Mask in that order. The reset signals to the DAC and/or the ADC are triggered immediately on the receipt of the Mask Byte.
 +
 
 +
 
 +
=== Ports ===
 +
 
 +
* ''Clk'': [in] clock
 +
 
 +
 
 +
Reset Signals
 +
* ''Rst: [in] asynchronous reset
 +
* ''DAC_iRst'': [out] active-low reset signal for the DAC chip.
 +
* ''SPI_iRst'': [out] active-low reset signal for the SPI bus (i.e. for the ADC)
 +
 
 +
 
 +
[[FPGA_Registers#State_Register|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
 +
 
 +
 
 +
[[FPGA_Registers#MAC_Register|MAC Address Register]] Control Lines
 +
* ''MACregs_En'': [out] register enable (write) signal
 +
* ''MACregs_A'': [out] byte address (4-bit)
 +
* ''MACregs_D'': [out] 8-bit input value
 +
 
 +
 
 +
* ''DBbyte'': [out] latched output bus that holds eight debug bits specified in the R' packet from PC. As of the time of writing this documentation, no use for these have been found.
 +
 
 +
 
 +
[[FPGA_Transceiver|Transceiver]] Control Lines
 +
* ''TxRx_Go'': [out] "Go" signal to read/write an EC control register byte
 +
* ''TxRx_Aout'': [out] EC control register address (8-bit)
 +
* ''TxRx_Dout'': [out] EC control register write value
 +
* ''TxRx_RiW'': [out] active-high read, active-low write flag
 +
* ''TxRx_Din'': [in] EC control register return value
 +
* ''TxRx_Done'': [in] "Done" signal from [[FPGA_Transceiver|Transceiver]].

Latest revision as of 19:57, 20 October 2009

See also Programming the Ethernet Controller for a survey of modules and a general discussion of FPGA design approach.

(00X) Reset Modules

The reset modules Reset_hard (000) and Reset_soft (001) coordinate various stages of the board reset. The former, analogous to the cold boot of a computer, performs the basic initial reset steps dealing mainly with the startup and configuration of the Ethernet Controller chip (EC). The latter module is a more customized second stage of full reset or just a soft reset that concerns the sensor and DAC chips. It also records the MAC address of the tagger-controlling PC for further communication. (This cannot be handled in the Reset_hard stage as all registers on the EC and FPGA are cleared and the PC's MAC address stamped on the hard reset packet (R-packet) cannot be saved)

The control packets type bytes leading to states 00X pertaining to these reset modules are:

Packet Type Byte Effect on the FPGA
Type Hex Bin State Description
R 0x52 0101 0010 000 "Reset_hard" instruction
"R'" 0xD2 1101 0010 001 Essentially an 'R' byte with '1' in the MSB instructing the FPGA to enter a reset cycle of the soft kind.

Both Reset modules yield control to the Transmitter to deliver a status packet to the PC (state 101).


Programming Details of Rest_hard

The Reset_hard module is written essentially as a list of module instantiations that perform EC control register read and write operations. The instances are "daisy-chained" to maintain chronological order - a "Done" signal from a preceding module is a "Go" for the following. Occasionally this list of instances is punctuated with counters intended to produce the required wait times and other specialized modules.

Programming the MAC interface requires the use of these specialized modules because the interface has an internal set of 16-bit control registers which are accessed indirectly through the use of general EC control registers. (See manual for more details.) The extra read/write operations necessary to use these indirect registers have been aggregated into MACwrToAddr in order to make this complication transparent to the higher level modules. These and other modules have in turn been used to create the MACaddrLoad module, which is responsible for loading the EC's factory-designated MAC address (stored in EC's flash memory) the above-mentioned indirect registers. This module also records a copy of these values in the MAC Address Register of the FPGA for the purpose of writing future packets.

Among other special modules, the INTcatcher is used to listen for "Self-Initialization Complete" interrupt (mask 0100). The Reset_hard block has also been instrumented with a dbShort external signal that "shorts out" the waiting counters for debig purposes.


Ports

  • Clk: [in] clock


Reset Signals

  • Rst: [in] asynchronous reset
  • Eth_iRst: [inout] EC active-low reset pin
  • Eth_iINT: [in] EC active-low interrupt signal


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


MAC Address Register Control Lines

  • MACregs_En: [out] register enable (write) signal
  • MACregs_A: [out] byte address (4-bit)
  • MACregs_D: [out] 8-bit input value


Transceiver Control Lines

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


Programming Details of Rest_soft

Reset_soft works like a counter, triggering a "Go" signal for an AutoRd module instance. A write signal to the MAC Address Register is also triggered for the first six bytes (payload bytes three through eight) as these represent the MAC address of the PC. The following two bytes are the Debug Byte and Chip Reset Mask in that order. The reset signals to the DAC and/or the ADC are triggered immediately on the receipt of the Mask Byte.


Ports

  • Clk: [in] clock


Reset Signals

  • Rst: [in] asynchronous reset
  • DAC_iRst: [out] active-low reset signal for the DAC chip.
  • SPI_iRst: [out] active-low reset signal for the SPI bus (i.e. for the ADC)


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


MAC Address Register Control Lines

  • MACregs_En: [out] register enable (write) signal
  • MACregs_A: [out] byte address (4-bit)
  • MACregs_D: [out] 8-bit input value


  • DBbyte: [out] latched output bus that holds eight debug bits specified in the R' packet from PC. As of the time of writing this documentation, no use for these have been found.


Transceiver Control Lines

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