File name
inc/board.sv
inc/board.sv
inc/board.sv
inc/board.sv
inc/board.sv
inc/board.sv
inc/board.sv
10 FPGA DEVELOPMENT
172
10.3 FPGA Verification Procedure
Task name
task automatic T_ADC_SPI(
input bit[2:0] csl,
input bit[15:0] sdi,
input bit[15:0] do_0a = '0,
input bit[15:0] do_0b = '0,
input bit[15:0] do_1a = '0,
input bit[15:0] do_1b = '0,
input bit[15:0] do_2a = '0,
input bit[15:0] do_2b = '0
);
task T_ADC_SPI_REG_WR(
input bit[2:0] csl,
input bit[5:0] adr,
input bit[7:0] dat);
task T_ADC_SPI_REG_RD(
input bit[2:0] csl,
input bit[5:0] adr,
input bit[7:0] dat,
input bit mode=0);
task T_ADC_SPI_CONV_RD(
input bit[15:0] ADC0_V[1:8],
input bit[15:0] ADC1_V[1:8],
input bit[15:0] ADC2_V[1:8]
);
task T_ADC_INITSEQ (
input bit[2:0] csl,
input bit mode[0:3],
input bit[3:0] range[0:3]='{4{'h3}},
input bit[7:0] oversamp='0,
input bit[5:0] gain[0:3]='{4{'h00}},
input bit[7:0] offset[0:3]='{4{'h80}},
input bit[7:0] phase[0:3]='{4{'h0}}
);
task T_DAC_SPI(
input bit [31:0] di);
task T_DAC_SPI_CONV_WR(
input bit[1:0] dut_adr,
input bit[15:0] dat
);
Description
Task for analog input/output circuit boards
Perform ADC SPI communication.
• csl: Chip select number (0 to 2)
• sdi: ADC serial data output
• do_0a: ADC0 cha data
• do_0b: ADC0 chb data
• do_1a: ADC1 cha data
• do_1b: ADC1 chb data
• do_2a: ADC2 cha data
• do_2b: ADC2 chb data
Task for analog input/output circuit boards
Execute ADC register write.
• csl: Chip select number (0 to 2)
• adr: Access address
• dat: Writing Data
Task for analog input/output circuit boards
Execute ADC register read.
• csl: Chip select number (0 to 2)
• adr: Access address
• dat: Expected value data
• mode: Select the ADC mode.
0b: ADC register read
1b: Change the mode in which the A/D conversion value is acquired periodically from the
ADC to ADC register read mode.
Task for analog input/output circuit boards
Read the A/D conversion value from the ADC. Perform SPI communication after CONVST
rises.
• ADC0_V: Set the expected value of the current/voltage input from the ADC.
(ADC0_V[1,3,5,7] current input, ADC0_V[2,4,6,8] voltage input)
• ADC1_V: Set the expected value of the current/voltage input from the ADC.
(ADC1_V[1,3,5,7] current input, ADC1_V[2,4,6,8] voltage input)
• ADC2_V: Set the expected value of the current/voltage input from the ADC.
(ADC2_V[1,3,5,7] current input, ADC2_V[2,4,6,8] voltage input)
Task for analog input/output circuit boards
Initialize the ADC.
• csl: chip select number
110b: ADC0
101b: ADC1
011b: ADC2
• mode: Select current or voltage
0: Current
1: Voltage
• range: ADC range setting
0001b: 5V single-ended
0010b: 10V single-ended
• oversamp: ADC oversampling setting
• gain: Setting prohibited (fixed to 0)
• offset: ADC offset setting
• phase: Setting prohibited (fixed to 0)
Task for analog input/output circuit boards
Perform DAC SPI communication.
• di: DAC serial data
Task for analog input/output circuit boards
Output the D/A conversion value.
• dut_adr: DUT address
00: ch0
01: ch1
• dat: D/A conversion value