add SPN configuration

This commit is contained in:
Stanislaw Kaushanski 2020-10-02 12:10:43 +02:00
parent 7d5de86015
commit 4720c923cd
3 changed files with 33 additions and 2 deletions

Binary file not shown.

View File

@ -94,9 +94,16 @@ void platform_init(){
int main() {
platform_init();
spn::start_reg()=1;
printf("Configure SPN HW accelerator\n");
spn::mode_reg() = 0;
spn::input_length_reg() = 1;
spn::input_addr_reg() = 0x80000000;
spn::output_addr_reg() = 0x80001000;
spn::num_of_in_beats_reg() = 1;
spn::num_of_out_beats_reg() = 1;
printf("set SPN Mode: 1\n");
printf("Start SPN HW accelerator\n");
spn::start_reg()=1;
delayUS(100);

View File

@ -73,6 +73,30 @@ public:
static inline start_t& start_reg(){
return *reinterpret_cast<start_t*>(BASE_ADDR+SPN_REG_START);
}
static inline uint32_t & mode_reg(){
return *reinterpret_cast<uint32_t*>(BASE_ADDR+SPN_REG_MODE);
}
static inline uint32_t & input_length_reg(){
return *reinterpret_cast<uint32_t*>(BASE_ADDR+SPN_REG_INPUT_LENGTH);
}
static inline uint32_t & input_addr_reg(){
return *reinterpret_cast<uint32_t*>(BASE_ADDR+SPN_REG_INPUT_ADDR);
}
static inline uint32_t & output_addr_reg(){
return *reinterpret_cast<uint32_t*>(BASE_ADDR+SPN_REG_OUTPUT_ADDR);
}
static inline uint32_t & num_of_in_beats_reg(){
return *reinterpret_cast<uint32_t*>(BASE_ADDR+SPN_REG_NUM_OF_INPUT_BEATS);
}
static inline uint32_t & num_of_out_beats_reg(){
return *reinterpret_cast<uint32_t*>(BASE_ADDR+SPN_REG_NUM_OF_OUTPUT_BEATS);
}
};
#endif // _SPN_REGS_H_