Example of Creating a Verilog HDL Custom Variation of the altcam Function
The following example procedure illustrates how to use the MegaWizard Plug-In Manager to create a custom megafunction variation of the altcam function. You can follow similar steps to create custom megafunction variations of other megafunctions. To create a custom megafunction variation of the altcam function:
On the Tools menu, click MegaWizard Plug-In Manager.
In the MegaWizard Plug-In Manager, in response to Which action do you want to perform?, select Create a new custom megafunction variation and click Next.
In response to Which type of output file do you want to create?, select Verilog HDL .
In the list of megafunctions, click on the + icon to expand the storage folder and select ALT_CAM.
In response to What name do you want for the output file?, type or browse to locate the appropriate file name or location. For this example, the path and file name should be C:\apexels\cam_wrapper_v.v.
Click Next.
To specify the size and operation mode of the CAM function:
In response to How wide should the 'data' input bus be?, select 32 bits.
Under Please specify the width of the CAM, select by the width of the 'address' input and select 5 bits.
In response to What is the operation mode of the CAM?, select Single match.
Click Next.
To specify the optional input and output ports:
In response to Which optional input ports do you want to use?, turn on 'wrx[]', 'wrxused' and 'wrdelete'.
In response to Which output ports do you want to use?, turn on 'maddress[]', 'mfound' and 'mcount[]'.
Click Next.
To register the input and output ports and create asynchronous clear and clock enable signals:
In response to Do you want to register the outputs?, select No.
In response to Which input ports should be registered?, turn on 'pattern port' and 'wrx' ["Don't care" pattern mask] port.
Turn on Create an 'aclr' asynchronous clear for the registered ports.
Turn on Create one clock enable signal for each clock signal.
To specify Which registered ports should be affected by the 'aclr' port, click on More Options.
In response to Do you want to specify the initial contents of the CAM?, select Yes.
In the File name box, type or browse to locate the appropriate file name or location. For this example, the file name should be my_cam.hex.
Note: If you use a "don't care" initialization, the file name must be <file name>_xu.hex.
Click Next.
The Summary page indicates the files that the MegaWizard Plug-In Manager will create based on your specifications. In this example, it generates the following files: