How to call the C testcase, for SOC verification

Hi All,
I am new to SOC verification. I verifying an ARM Cotrx M0 based SOC. I want to verify the I2C peripheral connected to the APB subsystem in the SOC. I have written a C test targeting the Control register of the I2C peripheral. I have compiled it and was able to load the generated hex file into the memory. But I do not know how to call the C test from my UVM tb. The test just starts and finishes without giving the required output. Would like to receive some inputs.

In reply to kevin488:

Could you please show some code, especially how your testcase looks like.
You can call any C function from your UVM testbench using the DPI interface.

In reply to kevin488:

You need to explain what the C code targeted at. Is it compiled to run on an ARM processor? Does your DUT contain the RTL for the ARM? or do you have a C model of the processor?

In reply to dave_59:

Hi Dave, thankyou for your response. The C code is targetted to program the control register of the I2C peripheral. The C code is compiled to run on an ARM processor. The DUT contains the RTL for the ARM, it does not have a C model of the processor.

In reply to chr_sue:

My C testcase looks like this :
include “CMSDK_CM0.h”
include <stdio.h>
include <string.h>
include <i2c_stdout.h>

int main(void)
{
I2C_INIT();

    return 0;

}

I2C_INIT is inlcuded in another file named i2c_stdout.c

include “CMSDK_CM0.h”

void I2C_INIT(void)
{
CMSDK_I2C → CNTRL = 0x12456AD0;
}

[i]In reply to kevin488:[/
You need to set the corresponding location of the HEX file ROM according to the distributed load Settings of the M0 kernel, and then the TB provides the clock to the M0 kernel and makes a reset.

Normally you would need to have a processor, either RTL or model sitting inside your DUT.
Compile the C code to get the binary, typically this would be integrated in your TB build flow.
Then backdoor load the binary to the instruction memory, like ITCM/DTCM if it’s ARM core.