Thank you for your reply! It was very helpful.
After your response, I downloaded the project from chipwhisperer-husky-fpga, generated a custom .bit file through Vivado, and tried to program the FPGA using ChipWhisperer as you described. I have been experimenting with both version 6.0.0 and 5.7.0 from the GitHub repository. During these experiments, I encountered a few questions that I would like to ask.
- When I do not upload a custom .bit file (i.e., simply define
scope = cw.scope()), what .bit file is uploaded to the FPGA by default? Where is it stored, and how is it loaded? Even though I am using the same Husky device, when I executed print(len(scope.SAD.reference)), version 6.0.0 output 512 while version 5.7.0 output 32. From this, I concluded that the default FPGA configuration differs depending on the version, and I am curious about the underlying mechanism of how the FPGA is initialized by default.
- To practice the basics of programming the FPGA using ChipWhisperer, I followed these steps:
a. Downloaded the project from chipwhisperer-husky-fpga.
b. Copied sad.v, renamed it customSad.v, and modified the module name from module sad to module customSad.
c. Edited openadc_interface.v to add the CUSTOMSAD definition.
`elsif SAD_SINGLE
sad_single_counter #(
.pBYTECNT_SIZE (pBYTECNT_SIZE),
.pREF_SAMPLES (pREF_SAMPLES),
.pSAD_COUNTER_WIDTH (pSAD_COUNTER_WIDTH),
.pBITS_PER_SAMPLE (8)
) U_sad (
.reset (reset ),
.xadc_error (xadc_error ),
.adc_datain (ADC_data_tofifo[11:4]),
.adc_sampleclk (ADC_clk_sample),
.armed_and_ready (armed_and_ready),
.active (sad_trigger_in_use),
.trigger_allowed (sad_active ),
.clk_usb (clk_usb ),
.reg_address (reg_address ),
.reg_bytecnt (reg_bytecnt ),
.reg_datai (reg_datai ),
.reg_datao (reg_datao_sad),
.reg_read (reg_read ),
.reg_write (reg_write ),
.ext_trigger (DUT_trigger_i),
.io4 (trigger_io4_i),
.trigger (trigger_sad )
);
`elsif CUSTOMSAD
customSad #(
.pBYTECNT_SIZE (pBYTECNT_SIZE),
.pREF_SAMPLES (pREF_SAMPLES),
.pSAD_COUNTER_WIDTH (pSAD_COUNTER_WIDTH),
.pBITS_PER_SAMPLE (8),
.pNUM_GROUPS (pNUM_GROUPS)
) U_sad_custom (
.reset (reset ),
.xadc_error (xadc_error ),
.adc_datain (ADC_data_tofifo[11:4]),
.adc_sampleclk (ADC_clk_sample),
.armed_and_ready (armed_and_ready),
.active (sad_trigger_in_use),
.trigger_allowed (sad_active ),
.clk_usb (clk_usb ),
.reg_address (reg_address ),
.reg_bytecnt (reg_bytecnt ),
.reg_datai (reg_datai ),
.reg_datao (reg_datao_sad),
.reg_read (reg_read ),
.reg_write (reg_write ),
.ext_trigger (DUT_trigger_i),
.io4 (trigger_io4_i),
.sad_debug (sad_debug ),
.trigger (trigger_sad )
);
d. Did not modify registers.v.
e. In Vivado TCL, executed set_property verilog_define {CUSTOMSAD} [get_filesets sources_1] to enable CUSTOMSAD and generated a .bit file.
f. Successfully uploaded the file using scope = cw.scope(bitstream=/path/to/bitfile).
However, when I ran print(len(scope.SAD.reference)), version 6.0.0 returned 0 and version 5.7.0 returned 1. My expectation was that since I only changed the module name in sad.v, it should still output 32. Why is this not the case? Did I miss something important?