Forum Discussion
Altera_Forum
Honored Contributor
16 years agoVerilog Help
Hey Guyz! I need some help with verilog coding. i got this code off opencore website that teaches us how to code a sd card controller.Below shows 2 of the verilog file. A) spiMaster_defin...
Altera_Forum
Honored Contributor
16 years agoAre you a C programmer? If so, the equivalent code for A) in C would be:
# ifdef SIM_COMPILE
# define SD_INIT_START_SEQ_LEN 0x03
# define MAX_8_BIT 0x08
# else
# define SD_INIT_START_SEQ_LEN 0xa0
# define MAX_8_BIT 0xff
# endif So the value of SD_INIT_SEQ_LEN is either 3 or 160 depending on whether or not SIM_COMPILE is defined. Most likely the designer defines the macro "SIM_COMPILE" when he wants to run a simulation because it takes less time. Jake