Software Application Example Design - 3.0 English

Binary CAM Search v3.0 LogiCORE IP Product Guide (PG317)

Document ID
PG317
Release Date
2024-05-30
Version
3.0 English

The CAM 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 SW driver API is described in CAM Driver API Description (cam-v3-0-api-reference.zip). The SW Application example design makes use of functions described in given description.

Note: You must navigate to the Documentation tab after the link is opened, to find the CAM Driver API Description.

After configuring the CAM 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.srcs/sources_1/ip/<cam_instance_name>/sw

For example, if the CAM IP instance name is cam_0, then the location would be:

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

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

Table 1. Sub-directory Descriptions
Sub-directory Description
sw/cam_src CAM IP obfuscated source code.
sw/dpi

DPI cam_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 CAM IP instance name chosen. For instance, if the CAM IP instance name is cam_0, then the files would be named:

  1. cam_0.c
  2. cam_0.h
  3. cam_0_example.c – top level containing "main"

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

Makefile – used by make to generate the executable. Name of the executable would be cam_0_example.

The Software Application example design performs the following tasks:

  1. Creates an instance of the CAM, based on the settings you selected, via the CAM API functions.
  2. Based on the input stimulus file data_stim.c.
    • insert entry
    • read entry by key
    • read entry by response
    • delete entry
  3. Print out the results to the console window.