Verify code functionality with testbench or other approach?

Technical questions regarding the xTIMEcomposer, xSOFTip Explorer and Programming with XMOS.
Posts: 10
Joined: Mon May 04, 2020 4:32 pm

Verify code functionality with testbench or other approach?

Postby SGapp » Wed Jun 24, 2020 5:35 pm

I created a project for streaming 32 PDM microphones via USB to a host. I started with the reference code from the "app_usb_aud_mic_array" example and extended it for my 32 PDM microphones on a XUF232.
After some tweaking the project now builds without errors. When using the simulator with tracing options I can see some movements on specific output ports. The design is driven by an external masterclock. Since the masterclock is generated from an external crystal the signal is not part of the simulation. Therefore, I can't verify that my code works the way I intended it to work.

I have experience with FPGA designs. For an FPGA design I would now create a testbench, which also simulates the external components. In this case that would be the PDM microphones and the master clock.
The xTimeComposer User Guide ... (14.x).pdf introduces Testbenches and Plugins in Sec.23. I tried to implement the example testbench from Sec. 23.3 but xTimecomposer keeps telling me, that it can't find "xsidevice.h".

Is creating a testbench the correct approach or are there other/better approaches? Where can I download the xsidevice data?
Thank you very much.
User avatar
Respected Member
Posts: 447
Joined: Thu Nov 26, 2015 11:47 pm

Postby akp » Fri Jun 26, 2020 9:31 am

I think you need to compile your testbench natively for your OS per Sec 23.3, you don't compile it in xTIMEcomposer I am pretty sure. In Windows 64 the xsidevice.h would be in C:\Program Files (x86)\XMOS\xTIMEcomposer\Community_14.4.1\include and the dll library you link against is in C:\Program Files (x86)\XMOS\xTIMEcomposer\Community_14.4.1\lib. For Mac and Linux the files are in the similarly named directories.

I have never used it myself. What I usually do is write testbench code to run on a different tile of the chip, and then in the simulator setup connect up the pins on the tile with the code under test to the tile that runs the test bench. That is pretty easy if you want to try that.

Who is online

Users browsing this forum: No registered users and 3 guests