diff --git a/raven_spn/raven_spn b/raven_spn/raven_spn index f426bcb..cee7a80 100755 Binary files a/raven_spn/raven_spn and b/raven_spn/raven_spn differ diff --git a/raven_spn/src/raven_spn.cpp b/raven_spn/src/raven_spn.cpp index 178fb5b..b0266c1 100644 --- a/raven_spn/src/raven_spn.cpp +++ b/raven_spn/src/raven_spn.cpp @@ -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); diff --git a/raven_spn/src/spn_regs.h b/raven_spn/src/spn_regs.h index 9efb417..59b2e98 100644 --- a/raven_spn/src/spn_regs.h +++ b/raven_spn/src/spn_regs.h @@ -73,6 +73,30 @@ public: static inline start_t& start_reg(){ return *reinterpret_cast(BASE_ADDR+SPN_REG_START); } + + static inline uint32_t & mode_reg(){ + return *reinterpret_cast(BASE_ADDR+SPN_REG_MODE); + } + + static inline uint32_t & input_length_reg(){ + return *reinterpret_cast(BASE_ADDR+SPN_REG_INPUT_LENGTH); + } + + static inline uint32_t & input_addr_reg(){ + return *reinterpret_cast(BASE_ADDR+SPN_REG_INPUT_ADDR); + } + + static inline uint32_t & output_addr_reg(){ + return *reinterpret_cast(BASE_ADDR+SPN_REG_OUTPUT_ADDR); + } + + static inline uint32_t & num_of_in_beats_reg(){ + return *reinterpret_cast(BASE_ADDR+SPN_REG_NUM_OF_INPUT_BEATS); + } + + static inline uint32_t & num_of_out_beats_reg(){ + return *reinterpret_cast(BASE_ADDR+SPN_REG_NUM_OF_OUTPUT_BEATS); + } }; #endif // _SPN_REGS_H_