Changes

Jump to navigation Jump to search
822 bytes added ,  22:48, 5 June 2008
m
no edit summary
Line 9: Line 9:     
To the right is a diagram depicting the structure of an Ethernet packet.  On the left side is marked the blocks that must be defined by the FPGA to be passed to the CP2200/1.  The first 8 bytes ("Preamble and Start Frame Delimiter") and last 4 bytes ("CRC") will be generated by the CP2200/1, so the FPGA need not even be aware of them.  The first significant block is the 6-byte destination MAC address.  The FPGA will have to store this (internally or using the RAM supplied by the CP2200/1) and then insert it into the appropriate place.  The next block is the 6-byte source MAC address.  Each CP2200/1 comes with a factory-set unique MAC address stored in the last page of Flash memory that will be used as the source MAC address.  The next block is the 2-byte length block.  This is the number of bytes of data, which can be as small as 46 or as large as 1,500.  Then finally comes the data block, which must be padded to a minimum of 46 bytes but can not exceed 1,500 bytes.
 
To the right is a diagram depicting the structure of an Ethernet packet.  On the left side is marked the blocks that must be defined by the FPGA to be passed to the CP2200/1.  The first 8 bytes ("Preamble and Start Frame Delimiter") and last 4 bytes ("CRC") will be generated by the CP2200/1, so the FPGA need not even be aware of them.  The first significant block is the 6-byte destination MAC address.  The FPGA will have to store this (internally or using the RAM supplied by the CP2200/1) and then insert it into the appropriate place.  The next block is the 6-byte source MAC address.  Each CP2200/1 comes with a factory-set unique MAC address stored in the last page of Flash memory that will be used as the source MAC address.  The next block is the 2-byte length block.  This is the number of bytes of data, which can be as small as 46 or as large as 1,500.  Then finally comes the data block, which must be padded to a minimum of 46 bytes but can not exceed 1,500 bytes.
 +
    
=== Receiving ===
 
=== Receiving ===
    
The CP2200/1 appears to give access to the entire 64-byte (minimum) packet, which would include everything on the above diagram except for the "Preamble and Start Frame Delimiter".  The CP2200/2 can be programmed to filter out any packets not addressed to it.  However, it only verifies the first 5 bytes of the MAC address.  Checking the 6th byte and using the skip procedure is left to the FPGA.  For good packets the FPGA can strip away and ignore the first 14 bytes (it does not need the length field, as we define our own standard for the packets below, using the first data byte to specify the type of packet).  From there the FPGA can parse the data field according to the below specifications.
 
The CP2200/1 appears to give access to the entire 64-byte (minimum) packet, which would include everything on the above diagram except for the "Preamble and Start Frame Delimiter".  The CP2200/2 can be programmed to filter out any packets not addressed to it.  However, it only verifies the first 5 bytes of the MAC address.  Checking the 6th byte and using the skip procedure is left to the FPGA.  For good packets the FPGA can strip away and ignore the first 14 bytes (it does not need the length field, as we define our own standard for the packets below, using the first data byte to specify the type of packet).  From there the FPGA can parse the data field according to the below specifications.
 +
    
== Our packets ==
 
== Our packets ==
    
We will use six types of packets in our communications, paired into three "conversations" or "cycles": a reset cycle, a query cycle, a programming cycle.  Each packet's data section will begin with a single-byte code to identify the packet type.  As a mnemonic, these bytes will use ASCII codes to represent a single-letter shorthand for each packet.
 
We will use six types of packets in our communications, paired into three "conversations" or "cycles": a reset cycle, a query cycle, a programming cycle.  Each packet's data section will begin with a single-byte code to identify the packet type.  As a mnemonic, these bytes will use ASCII codes to represent a single-letter shorthand for each packet.
 +
    
=== The reset cycle ===
 
=== The reset cycle ===
 +
 +
[[Image:OperationCourse.png|thumb|255px|Operation course between the digital board and the controller PC]]
    
The reset cycle is a conversation whose purpose is to reset the digital control board.  On each power-on, the various chips on the digital board need to be re-initialized.  This includes the Ethernet chip itself, so the reset functionality needs to be built into the FPGA logic by default and needs to execute on start-up with no external stimulus in order to obtain Ethernet control.  However it may also be necessary to instigate a reset externally for some reason.  This cycle allows the external PC to initiate a reset and will notify the PC when the system is fully initialized.
 
The reset cycle is a conversation whose purpose is to reset the digital control board.  On each power-on, the various chips on the digital board need to be re-initialized.  This includes the Ethernet chip itself, so the reset functionality needs to be built into the FPGA logic by default and needs to execute on start-up with no external stimulus in order to obtain Ethernet control.  However it may also be necessary to instigate a reset externally for some reason.  This cycle allows the external PC to initiate a reset and will notify the PC when the system is fully initialized.
   −
==== "R" packet: reset ====
+
Additionally, the reset cycle gives the tagger boards and PC a chance to build the proper address maps. The boards acquire the MAC address of the PC and the PC builds a MAC-Location table, where the "Location" is a hard-coded 8-bit slot identifier hard-coded into the bus-board. This organization step is necessary for the PC to be able to pinpoint SiPM channel groups.
 +
 
 +
 
 +
==== "R" packets: reset ====
 +
 
 +
This group of packets sent from the PC to the card to initiate a reset process in various forms.  Two possible reset packets (corresponding to two degrees of reset) are possible
 +
* Full or "Hard" reset: This resets all chips on the board. This will contain no data as no further instructions can be remembered after a board reset.
 +
* Selective or "Soft" reset: This will have flags to reset the Ethernet chip, the ADC/Temperature sensor group (SPI bus), and the DAC. 
 +
 
 +
 
 +
===== R-packet - hard reset =====
 +
 
 +
The packet type byte (2nd in packet payload) will be an ASCII '''R''': 0x52, 0101 0010. This packet orders control passed to the [[FPAG_Reset|Reset_hard]] module which resets the Ethernet Controller chip (EC) loads its own MAC address and transmits an [[#"S" packet: status report]] to confirm completion of this stage and allow the PC to pair the source MAC address with the included slot Location address (always in the 1st byte of payload).
 +
 
 +
 
   −
This is the packet sent from the PC to the card to initiate a reset process.  Two possible reset packet ideas can be considered:
+
  For a full-reset-only design, all remaining bytes in the packet will be padding that the FPGA can ignore.  For a selective-reset design, the second data byte will contain the four flags, and all bytes after that will be padding.  A selective-reset design allows a form of "Are you awake" query to the board: Send a reset packet with all reset flags turned off; the system will not reset any devices but will still respond with an "I" packet.  This may be an unnecessary feature, as the query cycle already acts as a more complex "Are you awake" query.
* Full reset: This resets all chips on the board (except for the FPGA; that should reset only during a power-up) together.  This will contain no data.
  −
* Selective reset: This will have flags to reset the Ethernet chip, the ADC, the temperature sensor, and the DAC.  Combinations of flags allow a selective reset of any combination of the four chips.  This will contain four flags which can be packaged into a single byte.
  −
The first data byte will be an ASCII '''R''': 0x52, 0101 0010.  For a full-reset-only design, all remaining bytes in the packet will be padding that the FPGA can ignore.  For a selective-reset design, the second data byte will contain the four flags, and all bytes after that will be padding.  A selective-reset design allows a form of "Are you awake" query to the board: Send a reset packet with all reset flags turned off; the system will not reset any devices but will still respond with an "I" packet.  This may be an unnecessary feature, as the query cycle already acts as a more complex "Are you awake" query.
      
==== "I" packet: initialization complete ====
 
==== "I" packet: initialization complete ====
1,004

edits

Navigation menu