好吧,首先我们得从JTAG说起。JTAG,全称是Joint Test Action Group,说白了就是一群人聚在一起想出了一个测试芯片互连线的方法。最初,他们的目标是让芯片之间的互连测试变得简单。然后事情变得越来越复杂,因为我们总是想着“要不再加点功能吧?”。于是,JTAG不仅用来测试互连线,还被用来调试芯片内部的各种IP(Intellectual Property)。通过JTAG指令集,我们可以激活某个IP的TDR(Test Data Register),然后进行操纵和观测。
但是,问题来了。随着芯片上IP数量的增加,JTAG的指令集也变得越来越庞大,指令解码器复杂到让工程师们每天都要多喝两杯咖啡才能应付。此外,JTAG的广播架构对芯片设计阶段的P&R(Placement and Routing)不太友好,测试模式一旦在设计阶段确定,就缺乏灵活性。更糟糕的是,JTAG标准并未明确定义TDR如何操纵IP。
ModuleSensor {DataInPortEn;DataOutPortTemp[3:0];}ModuleTDR {ScanInPortsi;ScanOutPortso {Source EN_reg};ShiftEnse;UpdateEnue;DataInPortTemp[3:0];DataOutPortEn {Source EN_Reg};ScanRegisterSR[3:0] {ScanInSourcesi;CaptureSourceTemp;}ScanRegisterEN_reg {ScanInSourceSR[0];}}ModuleSIB {ScanInPortsi;ScanInPortfso;ScanOutPortso {Source sib;}ScanOutPorttsi {Source si;}ShiftEnse;UpdateEnue;ScanRegistersib {ScanInSourcemux;CaptureSource1’b0;ResetValue1’b0;}ScanMuxmux SelectedBy sib {1’b0 : si;1’b1: fso;}}Modulechip {TCKPortTCK;TMSPortTMS;ScanInPortTDI;ScanOutPortTDO;InstanceTAP_inst of TAP {InputPorttck = TCK;InputPorttms = TMS;InputPorttdi = TDI;InputPortsib_tdo = SIB_2.so;}InstanceSIB_1 of SIB {InputPortsi = TAP_inst.to_si;InputPortfso = TDR_1.so;}InstanceSIB_2 of SIB {InputPortsi = SIB_1.so;InputPortfso = TDR_2.so;}InstanceTDR_1 of TDR {InputPortsi = SIB_1.tsi;InputPortTemp = Sensor_1.Temp;}InstanceTDR_2 of TDR {InputPortsi = SIB_2.tsi;InputPortTemp = Sensor_2.Temp;}InstanceSensor_1 of Sensor {InputPortEn = TDR_1.En;}InstanceSensor_2 of Sensor {InputPortEn = TDR_2.En;}}ModuleTAP {TCKPorttck;TMSPorttms;ScanInporttdi;ScanOutPorttdo;ToShiftEnPortshift_en;ToUpdateEnPortupdate_en;ToCaptureEnPortcapture_en;}
PDL描述
接下来,我们通过PDL来描述如何配置和操作温度传感器。
iPDLLevel0;iProcForModuleSensor;iProcRead_Temperature {{cycles 100}} {iNote“Start the temperature monitor:”;iWriteEn 1;iApply;iNote“Executing:”iRunLoop$cycles –sclk system_clock;iApply;iNote“Reading temperature value:”iReadTemp[3:0];iApply;iNote“Turn off the temperature monitor:”iWriteen;iApply;}iPDLLevel0;iProcForModulechip;iMerge–beginiCallchip.sensor_1.Read_Temperature 200;iCallchip.sensor_2.Read_Temperature 200;iMerge-end