You copied the Doc URL to your clipboard.

How do I use Mali-C52 and Mali-C32 ISP Cmodel to generate reference data for creating new testcases?

Information in this article applies to:

  • Image Signal Processors


How do I use Mali-C52 and Mali-C32 ISP Cmodel to generate reference data for creating new testcases?




1. Run Cmodel.

In the hardware release package, you can find Cmodel files for Linux in the PACKAGE_ROOT/logical/models/c_model/ directory.

The directory contains the following files:

  • The Cmodel executable file, Lloyd_R0P0

  • The Cmodel header file, arm_model_api.h

  • The Cmodel library file,

To execute Cmodel, use the following command:

Lloyd_R0P0 -i run.scr   

The following files are used in executing Cmodel:

  • run.scr
    This is an execution script and must be provided to Cmodel by using the -i option.

  • input.frm
    This is an input frame file and must be specified in the run.scr file.

  • output.frm
    This is the final output frame file of Cmodel and can be used as reference data to be compared with RTL output. Specify the file in the run.scr file.

For details about other Cmodel options, see section 4, Executable command line parameters, of the Cmodel Integration Guide.

2. Create a .scr file for a new case.

The execution script file (.scr) performs the following operations:

  • Write ISP configuration register by using the wa or wr command.

  • Specify the input frame file (.frm) by using the indata comand.

  • Read Image Signal Processor (ISP) statistic registers by using the rr or ra command.

  • Specify the output frame file (.frm) by using the outdata command.

  • Include another script by using the script command.

An example of the run.scr file content is as follows:

    wa 0000001c 02160ec0 # Write registers.
    … # This is about writing registers.
    wa 0003416c 00000080 # Write registers.
    indata input.frm # The input frame is “input.frm”.
    outdata output.frm # The output frame is “output.frm”.
    process # Cmodel processes the input frame.
    ra 00008930 # Read registers.
    … # This is about reading registers.
    ra 00018e84 # Read registers.
    script other.scr # Call another script.

For details about the .scr file syntax, see section 5, Script file format, in the Cmodel Integration Guide.

3. Create a .frm file for the new case.

The frame file (.frm) is used by execution script as input and output files.

The frame file format is as follows:

    20(the LSB 20bits of the 32bits data are input to ISP, ISP indata is 20bit width)
    32 (each pixel occupies 32 bits in the frm file, little endian)
    004(each pixel has 4 layers, together)
    Byte1, byte2, byte3, byte4, byte5, Byte6, byte7, byte8, byte9, byte10, Byte11, byte12, byte13, byte14, byte15, Byte16, byte17, byte18, byte19, byte20, Byte21, byte22, byte23, byte24, byte25, Byte26, byte27, byte28, byte29, byte30, Byte31, byte32 …

In Image Signal Processor (ISP) hardware, there are four video input channels as follows. Each input channel is 20-bit wide.

  • vdata0

  • vdata1

  • vdata2

  • vdata3

For example, the first 32-byte bin data after the header is as follows:

    vdata0 data 1 = {byte4, byte3, byte2, byte1} [19:0]
    vdata1 data 1 = {byte8, byte7, byte6, byte5} [19:0]
    vdata2 data 1 = {byte12, byte11, byte10, byte9} [19:0]
    vdata3 data 1 = {byte16, byte15, byte14, byte13} [19:0]
    vdata0 data 2 = {byte20, byte19, byte18, byte17} [19:0]
    vdata1 data 2 = {byte24, byte23, byte22, byte21} [19:0]
    vdata2 data 2 = {byte28, byte27, byte26, byte25} [19:0]
    vdata3 data 2 = {byte32, byte31, byte30, byte29} [19:0]

For example, the data in the frame file is as follows:

    01,02,03,04,05,06,07,08,09,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32 …
    vdata0 data 1 = 20’h30201
    vdata1 data 1 = 20’h70605
    vdata2 data 1 = 20’h11009
    vdata3 data 1 = 20’h51413
    vdata0 data 2 = 20’h81716
    vdata1 data 2 = 20’h32221
    vdata2 data 2 = 20’h72625
    vdata3 data 2 = 20’h13029

4. Compare the RTL output with reference data that is generated by Cmodel.

After reference data is generated, the execution script (.scr) file and input frame (.frm) file can use testbenches to provide input for the RTL to generate the RTL output.

To verify whether RTL behaviors are correct, you can compare the RTL output with reference data that is generated by Cmodel.





Related Information

  • CModel Integration Guide, which can be found in the product bundle.