MODULE A2084 TITLE 'A2084A' "A2084A01.abl (c) Richard Studley, 2017" "A2075A05.abl (c) Kevan Hashemi, 2013" "Version 1 " "[04-JAN-2017] We adapt the code from P2075A05.abl to run" " a ring oscillator in ABEL. We remove the " " ansynchronous reset and toggle the power " " switches on the inverse of address bit 0. " "--------------------------------------------------------" "Constants" da_delay = 7; "CK periods to DA" dda_delay = 17; "CK periods to DDA" run_time = dda_delay+3; "CK periods to run" "Inputs" A pin 40; "LVDS Input" "Outputs" LB pin 47 istype 'com'; "Loop Back" WAKE5V, WAKE15V pin 38,16 istype 'com'; "Wake" TP1,TP2,TP3,TP4 pin 14,15,8,7 istype 'com'; B pin 48 istype 'com'; "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 = 0; 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 = 0; DA := (lt==da_delay); DDA.clk = !CK; DDA.aclr = 0; DDA := (lt==dda_delay); "The command or address bits enter a sixteen-bit shift register." [ER,Q1..Q16].clk = DA; [ER,Q1..Q16].aclr = 0; [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 = 0; [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 = 0; [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." WAKE5V = !DA0; WAKE15V = !DA0; "Repeated logic signal." B = A; "We enable the return LVDS driver when DC7 is set." LB = !DA0; TP1 = !AA & !DA0; TP2 = !DA0; TP3 = LB; TP4 = AA; END