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
- from Rev 53 to Rev 54
- ↔ Reverse comparison
Rev 53 → Rev 54
/bit_manipulation/makefile
181,7 → 181,7
|
# Link object files and show memory utilization |
main.elf: $(OBJ) |
@$(CC) $(CC_OPTS) -T $(LD_SCRIPT) $(OBJ) -o $@ |
@$(CC) $(CC_OPTS) -T $(LD_SCRIPT) $(OBJ) -o $@ -lm |
@echo "Memory utilization:" |
@$(SIZE) main.elf |
|
/bit_manipulation/neorv32_b_extension_intrinsics.h
44,115 → 44,7
#ifndef neorv32_b_extension_intrinsics_h |
#define neorv32_b_extension_intrinsics_h |
|
/**********************************************************************//** |
* @name Custom instructions helper macros |
**************************************************************************/ |
/**@{*/ |
|
//** Selection helper macro */ |
#define STR1(x) #x |
//** Selection helper macro 2 */ |
#define STR(x) STR1(x) |
|
//** Register address converter */ |
#define GET_REG_ADDR(x) REG_ADDR_##x |
|
#define REG_ADDR_x0 0 /**< register 0 */ |
#define REG_ADDR_x1 1 /**< register 1 */ |
#define REG_ADDR_x2 2 /**< register 2 */ |
#define REG_ADDR_x3 3 /**< register 3 */ |
#define REG_ADDR_x4 4 /**< register 4 */ |
#define REG_ADDR_x5 5 /**< register 5 */ |
#define REG_ADDR_x6 6 /**< register 6 */ |
#define REG_ADDR_x7 7 /**< register 7 */ |
#define REG_ADDR_x8 8 /**< register 8 */ |
#define REG_ADDR_x9 9 /**< register 9 */ |
#define REG_ADDR_x10 10 /**< register 10 */ |
#define REG_ADDR_x11 11 /**< register 11 */ |
#define REG_ADDR_x12 12 /**< register 12 */ |
#define REG_ADDR_x13 13 /**< register 13 */ |
#define REG_ADDR_x14 14 /**< register 14 */ |
#define REG_ADDR_x15 15 /**< register 15 */ |
#define REG_ADDR_x16 16 /**< register 16 */ |
#define REG_ADDR_x17 17 /**< register 17 */ |
#define REG_ADDR_x18 18 /**< register 18 */ |
#define REG_ADDR_x19 19 /**< register 19 */ |
#define REG_ADDR_x20 20 /**< register 20 */ |
#define REG_ADDR_x21 21 /**< register 21 */ |
#define REG_ADDR_x22 22 /**< register 22 */ |
#define REG_ADDR_x23 23 /**< register 23 */ |
#define REG_ADDR_x24 24 /**< register 24 */ |
#define REG_ADDR_x25 25 /**< register 25 */ |
#define REG_ADDR_x26 26 /**< register 26 */ |
#define REG_ADDR_x27 27 /**< register 27 */ |
#define REG_ADDR_x28 28 /**< register 28 */ |
#define REG_ADDR_x29 29 /**< register 29 */ |
#define REG_ADDR_x30 30 /**< register 30 */ |
#define REG_ADDR_x31 31 /**< register 31 */ |
#define REG_ADDR_zero 0 /**< register 0 - according to calling convention */ |
#define REG_ADDR_ra 1 /**< register 1 - according to calling convention */ |
#define REG_ADDR_sp 2 /**< register 2 - according to calling convention */ |
#define REG_ADDR_gp 3 /**< register 3 - according to calling convention */ |
#define REG_ADDR_tp 4 /**< register 4 - according to calling convention */ |
#define REG_ADDR_t0 5 /**< register 5 - according to calling convention */ |
#define REG_ADDR_t1 6 /**< register 6 - according to calling convention */ |
#define REG_ADDR_t2 7 /**< register 7 - according to calling convention */ |
#define REG_ADDR_s0 8 /**< register 8 - according to calling convention */ |
#define REG_ADDR_s1 9 /**< register 9 - according to calling convention */ |
#define REG_ADDR_a0 10 /**< register 10 - according to calling convention */ |
#define REG_ADDR_a1 11 /**< register 11 - according to calling convention */ |
#define REG_ADDR_a2 12 /**< register 12 - according to calling convention */ |
#define REG_ADDR_a3 13 /**< register 13 - according to calling convention */ |
#define REG_ADDR_a4 14 /**< register 14 - according to calling convention */ |
#define REG_ADDR_a5 15 /**< register 15 - according to calling convention */ |
#define REG_ADDR_a6 16 /**< register 16 - according to calling convention */ |
#define REG_ADDR_a7 17 /**< register 17 - according to calling convention */ |
#define REG_ADDR_s2 18 /**< register 18 - according to calling convention */ |
#define REG_ADDR_s3 19 /**< register 19 - according to calling convention */ |
#define REG_ADDR_s4 20 /**< register 20 - according to calling convention */ |
#define REG_ADDR_s5 21 /**< register 21 - according to calling convention */ |
#define REG_ADDR_s6 22 /**< register 22 - according to calling convention */ |
#define REG_ADDR_s7 23 /**< register 23 - according to calling convention */ |
#define REG_ADDR_s8 24 /**< register 24 - according to calling convention */ |
#define REG_ADDR_s9 25 /**< register 25 - according to calling convention */ |
#define REG_ADDR_s10 26 /**< register 26 - according to calling convention */ |
#define REG_ADDR_s11 27 /**< register 27 - according to calling convention */ |
#define REG_ADDR_t3 28 /**< register 28 - according to calling convention */ |
#define REG_ADDR_t4 29 /**< register 29 - according to calling convention */ |
#define REG_ADDR_t5 30 /**< register 30 - according to calling convention */ |
#define REG_ADDR_t6 31 /**< register 31 - according to calling convention */ |
|
//** Construct instruction word (32-bit) for R-type instruction */ |
#define CMD_WORD_R_TYPE(funct7, rs2, rs1, funct3, rd, opcode) \ |
( (opcode & 0x7f) << 0 ) + \ |
( (rd & 0x1f) << 7 ) + \ |
( (rs1 & 0x1f) << 15 ) + \ |
( (rs2 & 0x1f) << 20 ) + \ |
( (funct7 & 0x7f) << 25 ) + \ |
( (funct3 & 0x1f) << 12 ) |
|
//** Construct instruction word (32-bit) for I-type instruction */ |
#define CMD_WORD_I_TYPE(imm12, rs1_f5, funct3, rd, opcode) \ |
( (opcode & 0x7f) << 0 ) + \ |
( (rd & 0x1f) << 7 ) + \ |
( (rs1_f5 & 0x1f) << 15 ) + \ |
( (imm12 & 0xfff) << 20 ) + \ |
( (funct3 & 0x1f) << 12 ) |
|
//** Construct custom instruction for R-type instruction */ |
#define CUSTOM_INSTR_R_TYPE(funct7, rs2, rs1, funct3, rd, opcode) \ |
asm volatile (".word "STR(CMD_WORD_R_TYPE(funct7, GET_REG_ADDR(rs2), GET_REG_ADDR(rs1), funct3, GET_REG_ADDR(rd), opcode))"\n"); |
|
//** Construct custom instruction for R1-type instruction (register + 5-bit immediate/function_select) */ |
#define CUSTOM_INSTR_R1_TYPE(funct7, funct5, rs1, funct3, rd, opcode) \ |
asm volatile (".word "STR(CMD_WORD_R_TYPE(funct7, funct5, GET_REG_ADDR(rs1), funct3, GET_REG_ADDR(rd), opcode))"\n"); |
|
//** Construct custom instruction for I-type instruction */ |
#define CUSTOM_INSTR_I_TYPE(imm12, rs1, funct3, rd, opcode) \ |
asm volatile (".word "STR(CMD_WORD_I_TYPE(imm12, GET_REG_ADDR(rs1), funct3, GET_REG_ADDR(rd), opcode))"\n"); |
/**@}*/ |
|
|
// ################################################################################################ |
// "Intrinsics" |
// ################################################################################################ |
/blink_led/makefile
181,7 → 181,7
|
# Link object files and show memory utilization |
main.elf: $(OBJ) |
@$(CC) $(CC_OPTS) -T $(LD_SCRIPT) $(OBJ) -o $@ |
@$(CC) $(CC_OPTS) -T $(LD_SCRIPT) $(OBJ) -o $@ -lm |
@echo "Memory utilization:" |
@$(SIZE) main.elf |
|
/coremark/makefile
181,7 → 181,7
|
# Link object files and show memory utilization |
main.elf: $(OBJ) |
@$(CC) $(CC_OPTS) -T $(LD_SCRIPT) $(OBJ) -o $@ |
@$(CC) $(CC_OPTS) -T $(LD_SCRIPT) $(OBJ) -o $@ -lm |
@echo "Memory utilization:" |
@$(SIZE) main.elf |
|
/cpu_test/makefile
181,7 → 181,7
|
# Link object files and show memory utilization |
main.elf: $(OBJ) |
@$(CC) $(CC_OPTS) -T $(LD_SCRIPT) $(OBJ) -o $@ |
@$(CC) $(CC_OPTS) -T $(LD_SCRIPT) $(OBJ) -o $@ -lm |
@echo "Memory utilization:" |
@$(SIZE) main.elf |
|
/demo_freeRTOS/makefile
254,7 → 254,7
|
# Link object files and show memory utilization |
main.elf: $(OBJ) |
@$(CC) $(CC_OPTS) -T $(LD_SCRIPT) $(OBJ) -o $@ |
@$(CC) $(CC_OPTS) -T $(LD_SCRIPT) $(OBJ) -o $@ -lm |
@echo "Memory utilization:" |
@$(SIZE) main.elf |
|
/demo_gpio_irq/makefile
181,7 → 181,7
|
# Link object files and show memory utilization |
main.elf: $(OBJ) |
@$(CC) $(CC_OPTS) -T $(LD_SCRIPT) $(OBJ) -o $@ |
@$(CC) $(CC_OPTS) -T $(LD_SCRIPT) $(OBJ) -o $@ -lm |
@echo "Memory utilization:" |
@$(SIZE) main.elf |
|
/demo_nco/makefile
181,7 → 181,7
|
# Link object files and show memory utilization |
main.elf: $(OBJ) |
@$(CC) $(CC_OPTS) -T $(LD_SCRIPT) $(OBJ) -o $@ |
@$(CC) $(CC_OPTS) -T $(LD_SCRIPT) $(OBJ) -o $@ -lm |
@echo "Memory utilization:" |
@$(SIZE) main.elf |
|
/demo_neopixel/makefile
181,7 → 181,7
|
# Link object files and show memory utilization |
main.elf: $(OBJ) |
@$(CC) $(CC_OPTS) -T $(LD_SCRIPT) $(OBJ) -o $@ |
@$(CC) $(CC_OPTS) -T $(LD_SCRIPT) $(OBJ) -o $@ -lm |
@echo "Memory utilization:" |
@$(SIZE) main.elf |
|
/demo_pwm/makefile
181,7 → 181,7
|
# Link object files and show memory utilization |
main.elf: $(OBJ) |
@$(CC) $(CC_OPTS) -T $(LD_SCRIPT) $(OBJ) -o $@ |
@$(CC) $(CC_OPTS) -T $(LD_SCRIPT) $(OBJ) -o $@ -lm |
@echo "Memory utilization:" |
@$(SIZE) main.elf |
|
/demo_trng/makefile
181,7 → 181,7
|
# Link object files and show memory utilization |
main.elf: $(OBJ) |
@$(CC) $(CC_OPTS) -T $(LD_SCRIPT) $(OBJ) -o $@ |
@$(CC) $(CC_OPTS) -T $(LD_SCRIPT) $(OBJ) -o $@ -lm |
@echo "Memory utilization:" |
@$(SIZE) main.elf |
|
/demo_twi/makefile
181,7 → 181,7
|
# Link object files and show memory utilization |
main.elf: $(OBJ) |
@$(CC) $(CC_OPTS) -T $(LD_SCRIPT) $(OBJ) -o $@ |
@$(CC) $(CC_OPTS) -T $(LD_SCRIPT) $(OBJ) -o $@ -lm |
@echo "Memory utilization:" |
@$(SIZE) main.elf |
|
/demo_wdt/makefile
181,7 → 181,7
|
# Link object files and show memory utilization |
main.elf: $(OBJ) |
@$(CC) $(CC_OPTS) -T $(LD_SCRIPT) $(OBJ) -o $@ |
@$(CC) $(CC_OPTS) -T $(LD_SCRIPT) $(OBJ) -o $@ -lm |
@echo "Memory utilization:" |
@$(SIZE) main.elf |
|
/game_of_life/makefile
181,7 → 181,7
|
# Link object files and show memory utilization |
main.elf: $(OBJ) |
@$(CC) $(CC_OPTS) -T $(LD_SCRIPT) $(OBJ) -o $@ |
@$(CC) $(CC_OPTS) -T $(LD_SCRIPT) $(OBJ) -o $@ -lm |
@echo "Memory utilization:" |
@$(SIZE) main.elf |
|
/hello_world/makefile
181,7 → 181,7
|
# Link object files and show memory utilization |
main.elf: $(OBJ) |
@$(CC) $(CC_OPTS) -T $(LD_SCRIPT) $(OBJ) -o $@ |
@$(CC) $(CC_OPTS) -T $(LD_SCRIPT) $(OBJ) -o $@ -lm |
@echo "Memory utilization:" |
@$(SIZE) main.elf |
|
/hex_viewer/makefile
181,7 → 181,7
|
# Link object files and show memory utilization |
main.elf: $(OBJ) |
@$(CC) $(CC_OPTS) -T $(LD_SCRIPT) $(OBJ) -o $@ |
@$(CC) $(CC_OPTS) -T $(LD_SCRIPT) $(OBJ) -o $@ -lm |
@echo "Memory utilization:" |
@$(SIZE) main.elf |
|