OpenCores
URL https://opencores.org/ocsvn/neorv32/neorv32/trunk

Subversion Repositories neorv32

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /neorv32/trunk/sw/example/game_of_life
    from Rev 21 to Rev 22
    Reverse comparison

Rev 21 → Rev 22

/main.c
54,6 → 54,10
#define NUM_CELLS_Y 40
/** Delay between generations in ms */
#define GEN_DELAY 500
/** Symbol for dead cell */
#define CELL_DEAD (' ')
/** Symbol for alive cell */
#define CELL_ALIVE ('#')
/**@}*/
 
 
172,7 → 176,10
cell = get_cell(u, x, y); // state of current cell
n = get_neighborhood(u, x, y); // number of living neighbor cells
 
// classic rule set
// -- classic rule set --
// if center cell is dead -> cell comes to life when there are exactly 3 living cells around
// if center cell is alive -> stay alive if there are 2 or three living cells around
// else -> cell is/becomes dead
if (((cell == 0) && (n == 3)) || ((cell != 0) && ((n == 2) || (n == 3)))) {
set_cell((u + 1) & 1, x, y);
}
214,9 → 221,9
for (x=0; x<NUM_CELLS_X; x++) {
if (get_cell(u, x, y))
neorv32_uart_putc('#');
neorv32_uart_putc((char)CELL_ALIVE);
else
neorv32_uart_putc(' ');
neorv32_uart_putc((char)CELL_DEAD);
}
 
// end of line
/makefile
86,7 → 86,7
# Application start-up code
CORE_SRC += $(NEORV32_COM_PATH)/crt0.S
 
# Default linker script
# Linker script
LD_SCRIPT = $(NEORV32_COM_PATH)/neorv32.ld
 
# Main output files
141,9 → 141,8
all: $(APP_ASM) $(APP_EXE) $(APP_IMG)
 
# Check if making bootloader
# This will disable some functions in crt0.S that are not relevant for the bootloader
target bootloader: USER_FLAGS += -D__BOOTLOADER_START_CODE__
target bootloader: LD_SCRIPT = $(NEORV32_COM_PATH)/bootloader_neorv32.ld
# Use different base address and legth for instruction memory/"rom" (BOOTMEM instead of IMEM)
target bootloader: CC_OPTS += -Wl,--defsym=make_bootloader=1
 
 
# -----------------------------------------------------------------------------
262,7 → 261,6
@echo "---------------- Info: NEORV32 ----------------"
@echo "NEORV32 home folder (NEORV32_HOME): $(NEORV32_HOME)"
@echo "IMAGE_GEN: $(IMAGE_GEN)"
@echo "LD script: $(LD_SCRIPT)"
@echo "Core source files:"
@echo "$(CORE_SRC)"
@echo "Core include folder:"

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.