TITLE "VME decoder for BOOT chip"; CONSTANT framlonum = B"01010"; CONSTANT framhinum = B"01011"; CONSTANT bootnum = B"00000"; CONSTANT brainnum = H"0000"; CONSTANT bookframaddressnum = H"0001"; CONSTANT testclocknum = H"0002"; CONSTANT hfinitnum = H"0003"; CONSTANT eventctrnum = H"0004"; CONSTANT lastaddrnum = H"0005"; -- H"001x" is running readout time count CONSTANT idpromstream = 4; SUBDESIGN bootvmedecoder ( address[24..0] : INPUT; hfwrite : INPUT; addressstrobe : INPUT; bootmode : INPUT; hfload : INPUT; hffreeze : INPUT; vmeintdswrite : INPUT; vmeframread : OUTPUT; vmeframwrite : OUTPUT; vmebookframaddressread : OUTPUT; vmebookframaddresswrite : OUTPUT; vmehfbusread : OUTPUT; vmehfbuswrite : OUTPUT; vmetestclockwrite : OUTPUT; vmehfinitwrite : OUTPUT; vmebrainread : OUTPUT; vmebrainwrite : OUTPUT; vmeidtextread : OUTPUT; vmetimeread : OUTPUT; vmeeventctrread : OUTPUT; vmeeventctrreset : OUTPUT; vmelastaddrread : OUTPUT; ) VARIABLE devices[4..0],stream[3..0],subdevices[15..0],hfread,hfrwok:NODE; vmeidnumread : NODE; BEGIN devices[4..0] = address[24..20]; stream[3..0] = address[19..16]; subdevices[15..0] = address[15..0]; hfread = !hfwrite; hfrwok = (hfload # hffreeze); vmeidnumread = (devices[] == bootnum) & (stream[] == idpromstream) & (subdevices[15..2] == 0) & hfread & !bootmode; vmeidtextread = (devices[] == bootnum) & (stream[] == idpromstream) & (subdevices[4..2] != 0) & (subdevices[15..5] == 0) & hfread & addressstrobe; vmeframread = hfrwok & ((devices[] == framlonum) # (devices[] == framhinum)) & hfread & addressstrobe; vmeframwrite = hfrwok & ((devices[] == framlonum) # (devices[] == framhinum)) & hfwrite & addressstrobe; vmebookframaddressread = hfrwok & (devices[] == bootnum) & (stream[] == 0) & (subdevices[] == bookframaddressnum) & hfread & addressstrobe; vmebookframaddresswrite = hfrwok & (devices[] == bootnum) & (stream[] == 0) & (subdevices[] == bookframaddressnum) & hfwrite & addressstrobe; vmehfbusread = ((devices[] != bootnum) # vmeidnumread) & (devices[] != framlonum) & (devices[] != framhinum) & hfread & !bootmode; vmehfbuswrite = hfrwok & (devices[] != bootnum) & (devices[] != framlonum) & (devices[] != framhinum) & hfwrite & !bootmode; vmetestclockwrite = (devices[] == bootnum) & (stream[] == 0) & (subdevices[] == testclocknum) & hfwrite & addressstrobe; vmehfinitwrite = (devices[] == bootnum) & (stream[] == 0) & (subdevices[] == hfinitnum) & hfwrite & addressstrobe; vmebrainread = (devices[] == bootnum) & (stream[] == 0) & (subdevices[] == brainnum) & hfread & addressstrobe; vmebrainwrite = (devices[] == bootnum) & (stream[] == 0) & (subdevices[] == brainnum) & vmeintdswrite; vmetimeread = (devices[] == bootnum) & (stream[] == 0) & (subdevices[15..4] == 1) & hfread & addressstrobe; vmeeventctrread = (devices[] == bootnum) & (stream[] == 0) & (subdevices[] == eventctrnum) & hfread & addressstrobe; vmeeventctrreset = (devices[] == bootnum) & (stream[] == 0) & (subdevices[] == eventctrnum) & hfwrite & addressstrobe; vmelastaddrread = (devices[] == bootnum) & (stream[] == 0) & (subdevices[] == lastaddrnum) & hfread & addressstrobe; END;