"
module P2078A title 'P2078A' "Version 1" "[14-AUG-13] Adapted from A207505A." declarations "Constants" da_delay = 7; "CK periods to DA" dda_delay = 16; "CK periods to DDA" run_time = dda_delay+3; "CK periods to run" hbcam = 1; "Inputs" A pin 3; "LVDS Input" !RST pin 4;"Power-Up Reset" "Outputs" LB pin 28 istype 'com'; "Loop Back" TP1,TP2 pin 31,32 istype 'com'; ON1..ON14 pin 14, 15, 16, 20, 21, 22, 23, 38, 39, 40, 45, 46, 47, 48 istype 'com'; WAKE node istype 'com'; "Wake" "Command Receiver Nodes" SA node istype 'reg'; "Synchronized A" DSA node istype 'reg'; "Delayed SA" DA node istype 'reg'; "Delayed A Rising Edge" DDA node istype 'reg'; "Delayed DA" AA node istype 'reg'; "Address Active" CA node istype 'reg'; "Command Active" ER,Q1..Q16 node istype 'reg'; "Receiver Bits" LT4..LT0 node istype 'reg'; "LWDAQ Timer" lt = [LT4..LT0]; DS node istype 'com'; "Data Strobe" DC1..DC16 node istype 'reg';"Device Command Bits" DA0..DA15 node istype 'reg';"Device Address Bits" "Ring Oscillator Notes" RO1,RO2 node istype 'com,keep'; "Ring Oscillator" CK node istype 'reg,keep'; "Clock" RUN node istype 'reg,keep'; equations "Clock Generation" "----------------" "The RUN flag controls the ring oscillator. When the ring" "oscillator runs, it causes lt to increment. When lt reaches" "a threshold, we clear the RUN flag." RUN.aclr = (lt == run_time); RUN := 1; RUN.clk = A; "Here we generate our clock with a ring oscillator." "The ring oscillator consists of two combinatorial gates." RO1 = RO2; RO2 = !RO1 & RUN; CK.clk = RO1; CK:=!CK; "Command and Address Decoding" "----------------------------" "This LWDAQ receiver uses the 40-MHz data clock to generate" "the DA and DDA signals. We synchronise the incoming serial" "logic signal, A, with the data clock." "We synchronize A with DCK, and provide a delayed" "version of A that allows us to detect edges." [SA,DSA].clk = CK; [SA,DSA].aclr = RST; SA := A; DSA := SA; "This timer allows us to generate the Delayed A (DA)" "and Double-Delayed A (DDA) signals for serial reception." lt.clk = CK; lt.aclr = !RUN; lt := lt+1; DA.clk = !CK; DA.aclr = RST; DA := (lt==da_delay); DDA.clk = !CK; DDA.aclr = RST; DDA := (lt==dda_delay); "The command or address bits enter a sixteen-bit shift register." [ER,Q1..Q16].clk = DA; [ER,Q1..Q16].aclr = RST; [ER,Q1..Q16] := [SA,ER,Q1..Q15]; "Address Active, or AA, provides a pulse that begins with DDA" "on the start bit of an address transmission, and ends with DDA" "on the stop bit of an address transmission. We clock the receiver" "bits into the address register on a rising edge of AS." AA.clk = DDA; AA := (!AA & !CA & !SA & !ER) # (AA & !SA); [DA0..DA15].clk = !AA; [DA0..DA15].aclr = RST; [DA0..DA15] := [Q1..Q16]; "Command Active, or CA, provides a pulse that begins with DDA" "on the start bit of a command transmission, and ends with DDA" "on the stop bit of a command transmission. We clock the receiver" "bits into the command register on a rising edge of CS." CA.clk = DDA; CA := (!AA & !CA & !SA & ER) # (CA & !SA); [DC1..DC16].clk = !CA; [DC1..DC16].aclr = RST; [DC1..DC16] := [Q1..Q16]; "Data Strobe identifies a solitary low pulse on A. A" "solitary low pulse, combined with DTX, indicates that" "the drivers is expecting this device to upload eight" "bits of data." DS = DDA & SA & !AA & !CA; "Command Bit Allocation" "----------------------" "WAKE bit." WAKE = DC8; "We enable the return LVDS driver when DC7 is set." LB = DC7; "Switch outputs are active with the combination of" "the wake bit and the appropriate command word bit." ON1 = DC1 & WAKE; ON2 = DC2 & WAKE; ON3 = DC3 & WAKE; ON4 = DC4 & WAKE; ON5 = DC5 & WAKE; ON6 = DC6 & WAKE; ON7 = DC9 & WAKE; ON8 = DC10 & WAKE; ON9 = DC11 & WAKE; ON10 = DC12 & WAKE; ON11 = DC13 & WAKE; ON12 = DC14 & WAKE; ON13 = DC15 & WAKE; ON14 = DC16 & WAKE; "Test Points" "-----------" TP1 = CA; TP2 = DDA; end