Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
16 years ago

nios top level ...

`define flash_word // use word mode of flash

`ifdef flash_word

wire flash_16bit_ip_a0;

assign oflash_byte_n = 1'b1; // flash word mode configuration

`else

assign oflash_byte_n = 1'b0; // flash byte mode configuration

`endif

assign oflash_rst_n = 1'b1; // flash reset

assign oflash_wp_n = 1'b1; // flash write protect/programming acceleration

assign odram1_clk = odram0_clk; //fishy

wire cpu_clk;

what is the purpose for the `ifdef flash_word

1 Reply

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    It tests to see if the compile-time macro "FLASH_WORD" is defined. If so, it sets the signal "oFLASH_BYTE_N" to 1 otherwise it sets "oFLASH_BYTE_N" to 0. Clearly what this is doing is selecting between 8-bit and 16-bit mode on an external flash device.

    Jake