TITLE "VME decoder for HITMAN chip"; include "lpm_decode.inc"; include "lpm_ff.inc"; % device number map % CONSTANT hitmannum = 1; CONSTANT spynum = 2; CONSTANT cramlonum = 3; CONSTANT cramhinum = 4; CONSTANT fifonum = 5; % local address map for registered data in HITMAN % CONSTANT spycounternum = H"1100"; CONSTANT chipdefaultnum = H"1101"; CONSTANT maxnclustnum = H"1102"; CONSTANT nchipexpectnum = H"1103"; SUBDESIGN hmvmedecode ( vmewrite : INPUT; streamid[3..0] : INPUT; address[24..0] : INPUT; hf_freeze : INPUT; hf_load : INPUT; hf_init : INPUT; hf_test : INPUT; hf_as : INPUT; vmefifowrite : OUTPUT; vmecramread : OUTPUT; vmecramwrite : OUTPUT; vmecramaddrhighbit : OUTPUT; vmepedramread : OUTPUT; vmepedramwrite : OUTPUT; vmespyread : OUTPUT; vmespywrite : OUTPUT; ppspyread : OUTPUT; ppspywrite : OUTPUT; vmespycounterread : OUTPUT; vmespycounterreset : OUTPUT; vmechipidread[7..0] : OUTPUT; vmechipidwrite[7..0] : OUTPUT; vmethresholdread : OUTPUT; vmethresholdwrite : OUTPUT; vmechargecutread : OUTPUT; vmechargecutwrite : OUTPUT; vmechargebigread : OUTPUT; vmechargebigwrite : OUTPUT; vmemaxnclustread : OUTPUT; vmemaxnclustwrite : OUTPUT; vmenchipexpectwrite : OUTPUT; vmenchipexpectread : OUTPUT; ) VARIABLE devices[4..0],stream[3..0],subdevices[15..0]:NODE; decchipid : lpm_decode WITH (LPM_WIDTH = 3, LPM_DECODES = 8); BEGIN devices[4..0] = address[24..20]; stream[3..0] = address[19..16]; subdevices[15..0] = address[15..0]; decchipid.data[] = address[2..0]; vmefifowrite = hf_as & hf_load & ((stream[] == streamid[]) # (stream[] == 15)) & (devices[] == fifonum) & vmewrite; vmecramread = hf_as & hf_load & (stream[] == streamid[]) & ((devices[] == cramlonum) # (devices[] == cramhinum)) & !vmewrite; vmecramwrite = hf_as & hf_load & ((stream[] == streamid[]) # (stream[] == 15)) & ((devices[] == cramlonum) # (devices[] == cramhinum)) & vmewrite; vmecramaddrhighbit = hf_as & (devices[] == cramhinum); vmespyread = hf_as & (hf_freeze # hf_load) & (stream[] == streamid[]) & (devices[] == spynum) & !vmewrite; vmespywrite = hf_as & hf_load & ((stream[] == streamid[]) # (stream[] == 15)) & (devices[] == spynum) & vmewrite; vmepedramread = hf_as & hf_load & (stream[] == streamid[]) & (devices[] == hitmannum) & (subdevices[15..12] == H"0") & !vmewrite; vmepedramwrite = hf_as & hf_load & ((stream[] == streamid[]) # (stream[] == 15)) & (devices[] == hitmannum) & (subdevices[15..12] == H"0") & vmewrite; vmespycounterread = hf_as & (stream[] == streamid[]) & (devices[] == hitmannum) & (subdevices[] == spycounternum) & !vmewrite; vmespycounterreset = hf_as & ((stream[] == streamid[]) # (stream[] == 15)) & (devices[] == hitmannum) & (subdevices[] == spycounternum) & vmewrite; vmemaxnclustread = hf_as & (stream[] == streamid[]) & (devices[] == hitmannum) & (subdevices[] == maxnclustnum) & !vmewrite; vmemaxnclustwrite = hf_as & hf_load & ((stream[] == streamid[]) # (stream[] == 15)) & (devices[] == hitmannum) & (subdevices[] == maxnclustnum) & vmewrite; vmenchipexpectread = hf_as & (stream[] == streamid[]) & (devices[] == hitmannum) & (subdevices[] == nchipexpectnum) & !vmewrite; vmenchipexpectwrite = hf_as & vmewrite & hf_load & ((stream[] == streamid[]) # (stream[] == 15)) & (devices[] == hitmannum) & ((subdevices[] == nchipexpectnum) # (subdevices[] == chipdefaultnum)); vmechipidread = hf_as & (stream[] == streamid[]) & (devices[] == hitmannum) & (subdevices[15..4] == H"100") & decchipid.eq[] & !vmewrite; vmechipidwrite[] = hf_as & vmewrite & (devices[] == hitmannum) & hf_load & ((stream[] == streamid[]) # (stream[] == 15)) & (((subdevices[15..4] == H"100") & decchipid.eq[]) # (subdevices[] == chipdefaultnum)); vmethresholdread = hf_as & hf_load & (stream[] == streamid[]) & (devices[] == hitmannum) & (subdevices[15..4] == H"101") & !vmewrite; vmethresholdwrite = hf_as & hf_load & ((stream[] == streamid[]) # (stream[] == 15)) & (devices[] == hitmannum) & (subdevices[15..4] == H"101") & vmewrite; vmechargecutread = hf_as & (stream[] == streamid[]) & (devices[] == hitmannum) & (subdevices[15..4] == H"102") & !vmewrite; vmechargecutwrite = hf_as & hf_load & ((stream[] == streamid[]) # (stream[] == 15)) & (devices[] == hitmannum) & (subdevices[15..4] == H"102") & vmewrite; vmechargebigread = hf_as & (stream[] == streamid[]) & (devices[] == hitmannum) & (subdevices[15..4] == H"103") & !vmewrite; vmechargebigwrite = hf_as & hf_load & ((stream[] == streamid[]) # (stream[] == 15)) & (devices[] == hitmannum) & (subdevices[15..4] == H"103") & vmewrite; ppspyread = hf_test & !hf_load; ppspywrite = !hf_test & !hf_freeze & !hf_load; END;