Software Application Example Design - 1.0 English - PG427

Cached DRAM Binary CAM LogiCORE IP Product Guide (PG427)

Document ID
PG427
Release Date
2023-10-18
Version
1.0 English

The CDCAM IP generator core provides a quick way to run a C-based software example application and observe the behavior of the core by using the provided Software Application example design, which has a self-checking test bench.

The Software Driver API is described in CAM Driver API Description (cam-api-reference.zip). The Software Application example design makes use of functions described in this.

After configuring the CDCAM IP based on your design requirements, and selecting the Generate Output Products… option to generate the core outputs, the Software Application example design is created.

If the default directory location is specified, then a sw directory will be created at the following location:

<user_location>/project_1/project_1.gen/sources_1/ip/<cdcam_instance_name>/sw/sw_example

For example, if the CDCAM IP instance name is cdcam_0, then the location would be:

<user_location>/project_1/project_1.srcs/sources_1/ip/cdcam_0/sw

This sw directory contains the sub-directories detailed in the following table.

Table 1. Sub-directory Descriptions
Sub-directory Description
sw/cdcam_src CDCAM IP obfuscated source code
sw/dpi

DPI cdcam_dpi.so library generation.

Refer to the readme.txt file for instructions on how to use this if customization is required.

sw/sw_example Software Application Example Design

The following three file names will be prepended with the CDCAM IP instance name chosen.

For instance, if the CDCAM IP instance name is cdcam_0, then the files would be named:

  1. cdcam_0.c
  2. cdcam_0.h - top level containing "main"
  3. cdcam_0_example.c

data_stim.c – the stimulus file restricted to 10 entries only.

data_stim.h – contains exported definitions and function declarations

Makefile – used by make to generate the executable. The name of the executable would be cdcam_0_example.

The Software Application example design performs the following tasks:

  1. Creates an instance of the CDCAM, based on the settings you selected, via the CAM API functions.
  2. Based on the input stimulus file data_stim.c:
    1. Creates 10 random entries.
    2. Get the response (default) for the first entry.
    3. Inserts 10 entries into shadow memory using CAM API.
    4. Get responses of 10 inserted entries in shadow memory using CAM API.
    5. Get keys of 10 inserted entries in shadow memory using CAM API.
    6. Update an inserted entry’s response in shadow memory using the CAM API.
    7. Get the response of the updated entry in shadow memory using CAM API.
    8. Delete 10 entries in shadow memory using CAM API.
    9. Get responses of deleted entries using CAM API.
  3. Print out the results to the console window.