Custom Logic
Use the following links to browse through the frequently asked questions relevant to this area of soft design. For more in-depth, visual answers to commonly posed questions, use the links to the corresponding training videos, listed on the right.
- Is the Custom Wishbone Interface component's Internal Register item actually a physical register for reading/writing?
- What is the reset value for Internal Register items in a Custom Wishbone Interface component?
- Why can't I use code-level debugging for code added using a C Code Symbol?
- How do the data types for Parameter-type C Code Entries map to data types used in C source code?
Is the Custom Wishbone Interface component's Internal Register item actually a physical register for reading/writing?
When writing a value from the processor to your custom logic, the value will be latched into a register within the Custom Wishbone Interface component. This value persists until the next write to that internal register item.
When the processor is reading a value from your custom logic, the data from the custom logic will be forwarded to the Wishbone DAT_O bus. The data read is not stored in a register within the Custom Wishbone Interface component.
What is the reset value for Internal Register items in a Custom Wishbone Interface component?
After a reset, Internal Register items in the interface will be cleared to zero.
Why can't I use code-level debugging for code added using a C Code Symbol?
Unlike code in an embedded software project, it is not possible to debug C code that is added to an FPGA or Core project through use of a C Code Symbol and C-to-Hardware Compilation technology. This is because the C code in the exported function is transformed into a hardware circuit, not a series of instructions to be carried out by a host processor.
The only available avenue for test is use of a configurable logic analyzer (LAX) virtual instrument.
How do the data types for Parameter-type C Code Entries map to data types used in C source code?
A Parameter-type C Code Entry can be classed as one of the following data types:
- Boolean
- Floating Point
- Unsigned Integer
- Signed Integer.
The Boolean data type corresponds to the bool data type in C, as defined in stdbool.h
.
For the Floating Point data type, the associated Precision property can be set to Single
or Double
. These correspond to 32-bit float and 64-bit double C data types respectively.
For integer data types, the associated Integer Width property can be defined in the range 1
to 64
. You are not limited to the widths of C data types. The following table shows the mapping of variable integer widths (defined for the C Code Entry) to C data types.
Integer Width range specified for a C Code Entry with an integer data type... | is mapped to the following C unsigned integer types... | is mapped to the following C signed integer types... |
---|---|---|
1-8 | unsigned char, uint8_t | char, int8_t |
9-16 | unsigned short, uint16_t | short, int16_t |
17-32 | unsigned int, unsigned long, uint32_t | int, long, int32_t |
33-64 | unsigned long long, uint64_t | long long, int64_t |
This mapping becomes especially relevant during synchronization of C Code Entries with corresponding parameters in the exported C function.