diff --git a/README.md b/README.md index 0ecefd8e..b8ef9379 100644 --- a/README.md +++ b/README.md @@ -452,6 +452,8 @@ Run from the repository root run: ``` # For example : ./build/lowrisc_ibex_demo_system_0/sim-verilator/Vibex_demo_system -t --meminit=ram,./sw/build/demo/hello_world/demo +# Test Ip: +./build/lowrisc_ibex_demo_system_0/sim-verilator/Vibex_demo_system -t --meminit=ram,./sw/build/demo/test_ip/test_ip # You need to substitute the for a binary we have build above. ./build/lowrisc_ibex_demo_system_0/sim-verilator/Vibex_demo_system -t --meminit=ram, @@ -480,7 +482,7 @@ Stores: 55 Jumps: 21 Conditional Branches: 12 Taken Conditional Branches: 7 -Compressed Instructions: 164 +Compressed Instructions: 164 Multiply Wait: 0 Divide Wait: 0 ``` @@ -507,10 +509,14 @@ The `util/load_demo_system.sh` script can be used to load and run an application You can choose to immediately run it or begin halted, allowing you to attach a debugger. ```bash -# Run demo +# Test IP +./util/load_demo_system.sh run ./sw/build/demo/test_ip/test_ip +# Test Accelerator +./util/load_demo_system.sh run ./sw/build/demo/test_accel/test_accel +# Run Hello World ./util/load_demo_system.sh run ./sw/build/demo/hello_world/demo +# Run LCD Display ./util/load_demo_system.sh run ./sw/build/demo/lcd_st7735/lcd_st7735 - # Load demo and start halted awaiting a debugger ./util/load_demo_system.sh halt ./sw/build/demo/hello_world/demo ``` diff --git a/ibex_demo_system.core b/ibex_demo_system.core index 81ad49dc..2e585692 100644 --- a/ibex_demo_system.core +++ b/ibex_demo_system.core @@ -99,7 +99,7 @@ parameters: SRAMInitFile: datatype: str description: SRAM initialization file in vmem hex format - default: "../../../../../sw/c/build/blank/blank.vmem" + default: "../../../../../sw/build/blank/blank.vmem" paramtype: vlogparam # For value definition, please see ip/prim/rtl/prim_pkg.sv diff --git a/rtl/system/and_top.sv b/rtl/system/and_top.sv index 9a31903d..2bcca93e 100644 --- a/rtl/system/and_top.sv +++ b/rtl/system/and_top.sv @@ -8,9 +8,8 @@ module and_top ( input logic [3:0] device_be_i, input logic [31:0] device_wdata_i, output logic device_rvalid_o, - output logic [31:0] device_rdata_o, + output logic [31:0] device_rdata_o - output logic and2_irq_o ); localparam int unsigned AND_INPUT_REG = 32'h4; localparam int unsigned AND_OUTPUT_REG = 32'h8; @@ -31,13 +30,11 @@ module and_top ( always@(posedge clk or negedge rst_ni) begin if(!rst_ni) begin device_rvalid_o <= '0; - and2_irq_o <= '0; end else begin - and2_irq_o <= valid; + if(and_o_wr_en) begin {input_and[0], input_and[1]} <= device_wdata_i; enable <= 1'b1; - end if(and_i_rd_en) begin device_rvalid_o <= 1'b1; diff --git a/rtl/system/ibex_demo_system.sv b/rtl/system/ibex_demo_system.sv index c08c5171..7e34fa8e 100644 --- a/rtl/system/ibex_demo_system.sv +++ b/rtl/system/ibex_demo_system.sv @@ -15,7 +15,7 @@ module ibex_demo_system #( parameter int GpiWidth = 8, parameter int GpoWidth = 16, parameter int PwmWidth = 12, - parameter SRAMInitFile = "" + parameter SRAMInitFile = "../../sw/build/blank/blank.vmem" ) ( input logic clk_sys_i, input logic rst_sys_ni, @@ -182,7 +182,6 @@ module ibex_demo_system #( .device_rvalid_o(device_rvalid[Custom]), .device_rdata_o (device_rdata[Custom]), - .and2_irq_o (and2_irq) ); @@ -293,7 +292,7 @@ module ibex_demo_system #( .irq_software_i(1'b0), .irq_timer_i (timer_irq), .irq_external_i(1'b0), - .irq_fast_i ({13'b0, and2_irq, uart_irq}), + .irq_fast_i ({14'b0, uart_irq}), .irq_nm_i (1'b0), .scramble_key_valid_i('0), diff --git a/sw/c/common/CMakeLists.txt b/sw/c/common/CMakeLists.txt index 9e0f5075..6194e29c 100644 --- a/sw/c/common/CMakeLists.txt +++ b/sw/c/common/CMakeLists.txt @@ -1,13 +1,13 @@ add_library(common OBJECT demo_system.c uart.c timer.c gpio.c pwm.c spi.c crt0.S and2.c - example.c - k2c_activations.c - k2c_convolution_layers.c - k2c_core_layers.c - k2c_embedding_layers.c - k2c_helper_functions.c - k2c_merge_layers.c - k2c_normalization_layers.c - k2c_pooling_layers.c - k2c_recurrent_layers.c + # example.c + # k2c_activations.c + # k2c_convolution_layers.c + # k2c_core_layers.c + # k2c_embedding_layers.c + # k2c_helper_functions.c + # k2c_merge_layers.c + # k2c_normalization_layers.c + # k2c_pooling_layers.c + # k2c_recurrent_layers.c ) target_include_directories(common INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}") diff --git a/sw/c/common/accelerator.cpp b/sw/c/common/accelerator.cpp new file mode 100644 index 00000000..e69de29b diff --git a/sw/c/common/accelerator.h b/sw/c/common/accelerator.h new file mode 100644 index 00000000..5e31fa9b --- /dev/null +++ b/sw/c/common/accelerator.h @@ -0,0 +1,7 @@ +#ifndef ACCELERATOR_H__ +#define ACCELERATOR_H__ + +#include "stdint.h" + +#endif + diff --git a/sw/c/common/and2.c b/sw/c/common/and2.c index 8c834367..95b6baa3 100644 --- a/sw/c/common/and2.c +++ b/sw/c/common/and2.c @@ -4,6 +4,8 @@ #include "demo_system_regs.h" #include "dev_access.h" +#include "and2.h" + void write_input(uint32_t values) { enable_interrupts(AND_IRQ); set_global_interrupt_enable(1); @@ -11,5 +13,8 @@ void write_input(uint32_t values) { } uint32_t get_result() { - return DEV_READ(AND_OUTPUT_REG); -} \ No newline at end of file + uint32_t result = 1; + result = DEV_READ(AND_OUTPUT_REG); + return result; +} + diff --git a/sw/c/demo/CMakeLists.txt b/sw/c/demo/CMakeLists.txt index 8f8533ec..27834857 100644 --- a/sw/c/demo/CMakeLists.txt +++ b/sw/c/demo/CMakeLists.txt @@ -1,4 +1,4 @@ add_subdirectory(hello_world) add_subdirectory(lcd_st7735) -add_subdirectory(simpleserial-aes) -add_subdirectory(basic-passwdcheck) +add_subdirectory(test_ip) +add_subdirectory(test_accel) diff --git a/sw/c/demo/basic-passwdcheck/CMakeLists.txt b/sw/c/demo/basic-passwdcheck/CMakeLists.txt deleted file mode 100644 index d4b2c082..00000000 --- a/sw/c/demo/basic-passwdcheck/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -add_definitions(-DSS_VER=1 -DHAL_TYPE=HAL_ibex) - -include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../../vendor/newae/crypto) -include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../../vendor/newae/hal) -include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../../vendor/newae/simpleserial) -include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../common) - - -add_executable(basic-passwdcheck ${CMAKE_CURRENT_SOURCE_DIR}/../../../../vendor/newae/basic-passwdcheck/basic-passwdcheck.c) - -target_link_libraries(basic-passwdcheck common simpleserial) - diff --git a/sw/c/demo/basic-passwdcheck/README b/sw/c/demo/basic-passwdcheck/README deleted file mode 100644 index b2a41b43..00000000 --- a/sw/c/demo/basic-passwdcheck/README +++ /dev/null @@ -1,23 +0,0 @@ -ChipWhisperer basic-passwdcheck application, intended to be run on a -ChipWhisperer FPGA target (synth_cw305 or synth_cw312a35 targets). - -This can then be used with NewAE's "Power Analysis for Password Bypass" -notebook -(https://github.com/newaetech/chipwhisperer-jupyter/tree/master/courses/sca101/), -with modifications to the target clock and baud rate: - scope.clock.adc_mul = 1 # if using CW-Husky - scope.clock.adc_src = 'clkgen_x1' # if using CW-lite/pro - scope.clock.clkgen_freq = 100e6 - target.baud = 115200 - -Note that the password bypass attack will not work well on the CW305 target -since that target lacks a method to reset the Ibex processor from the host PC -(top_cw305.sv could be modified to achieve this). However it will work on the -CW312-A35 target. - -Note that this application (and many others!) can also be built in the -ChipWhisperer repository: - https://github.com/newaetech/chipwhisperer/tree/develop/hardware/victims/firmware/basic-passwdcheck/ -using: - make PLATFORM=CW305_IBEX CRYPTO_TARGET=NONE - diff --git a/sw/c/demo/hello_world/CMakeLists.txt b/sw/c/demo/hello_world/CMakeLists.txt index 2505df7b..13c8ea32 100644 --- a/sw/c/demo/hello_world/CMakeLists.txt +++ b/sw/c/demo/hello_world/CMakeLists.txt @@ -1,2 +1,2 @@ add_executable(demo main.c) -target_link_libraries(demo common m) +target_link_libraries(demo common) \ No newline at end of file diff --git a/sw/c/demo/hello_world/main.c b/sw/c/demo/hello_world/main.c index cb9fcfad..cda38802 100644 --- a/sw/c/demo/hello_world/main.c +++ b/sw/c/demo/hello_world/main.c @@ -1,752 +1,106 @@ -#include -#include -#include +// Copyright lowRISC contributors. +// Licensed under the Apache License, Version 2.0, see LICENSE for details. +// SPDX-License-Identifier: Apache-2.0 + +#include -#include "and2.h" #include "demo_system.h" -#include "example.h" -#include "k2c_include.h" -#include "stdint.h" +#include "gpio.h" +#include "pwm.h" +#include "timer.h" + +#define USE_GPIO_SHIFT_REG 0 + +void test_uart_irq_handler(void) __attribute__((interrupt)); + +void test_uart_irq_handler(void) { + int uart_in_char; + + while ((uart_in_char = uart_in(DEFAULT_UART)) != -1) { + uart_out(DEFAULT_UART, uart_in_char); + uart_out(DEFAULT_UART, '\r'); + uart_out(DEFAULT_UART, '\n'); + } +} + +int main(void) { + install_exception_handler(UART_IRQ_NUM, &test_uart_irq_handler); + uart_enable_rx_int(); + + // This indicates how often the timer gets updated. + timer_init(); + timer_enable(5000000); + + uint64_t last_elapsed_time = get_elapsed_time(); -float maxabs(k2c_tensor *tensor1, k2c_tensor *tensor2); -struct timeval GetTimeStamp(); + // Reset green LEDs to having just one on + set_outputs(GPIO_OUT, 0x10); // Bottom 4 bits are LCD control as you can see in top_artya7.sv -// int main() { -// float test1_input_1_input_array[256] = { -// -1.09487110e-01,1.93387878e+00,-2.97306259e-01,3.12030221e-01,1.57628086e+00, -// 3.94178346e-01,1.78848197e+00,6.75566038e-01,2.85979855e-01,1.16328701e+00, -// -8.77038376e-01,-5.65439166e-01,2.74985200e-01,1.45548785e+00,-2.06603463e-01, -// -1.10901008e-01,1.89572009e+00,8.91481911e-01,-4.25013839e-01,-1.10356236e+00, -// 8.33558190e-01,-1.01295452e+00,1.09661559e+00,1.58457126e+00,-4.35388440e-01, -// 9.18043864e-01,-1.97922167e+00,1.91028879e+00,5.39593638e-01,-6.70869006e-01, -// 1.67570268e+00,7.42886494e-03,-3.63233062e-01,-3.21416404e-01,1.70597685e+00, -// -1.08749028e+00,1.26725895e+00,-8.87998019e-01,-1.95193309e+00,1.83151444e+00, -// 1.28482118e+00,-1.04658115e-01,-1.95691674e+00,5.87517752e-01,-9.44218556e-01, -// 1.31758786e+00,-1.33929752e+00,-8.42150211e-01,-1.22685707e+00,-2.80205494e-01, -// -1.24708565e+00,-1.19129402e+00,5.27056282e-01,-1.91979719e+00,-1.93680255e+00, -// 1.14091613e-01,1.52748030e+00,7.88656092e-01,-5.85547010e-01,1.80792353e+00, -// -2.39063347e-01,-1.14448886e+00,-1.59712025e+00,6.27430425e-01,-1.19491640e+00, -// -4.39337900e-01,1.09399688e+00,4.15198501e-02,4.65160836e-01,-3.36798776e-01, -// -1.46598496e+00,6.83248299e-02,-1.78877679e+00,1.07925138e+00,-8.22989902e-01, -// -1.36692652e+00,1.73367450e+00,-3.60811018e-01,-1.72471730e-01,1.75631018e+00, -// 6.65034660e-01,7.65960672e-01,-3.74708874e-01,-8.91538163e-01,1.61841338e-01, -// 5.56011806e-01,3.78519637e-01,-1.13382276e-01,-8.53267053e-01,-6.76574421e-02, -// 5.20876001e-01,-5.29804051e-01,-1.94213403e+00,1.72996498e+00,3.74337875e-01, -// 1.97834755e-01,-1.36469054e+00,6.21310086e-01,-8.36315686e-02,1.80363501e+00, -// 8.68780647e-01,1.92455827e+00,-1.11284785e+00,-1.23180824e+00,7.61561303e-01, -// 1.64030975e+00,-1.28855933e+00,1.40752092e+00,9.79390687e-02,1.01408748e+00, -// 1.08392002e+00,-4.52245073e-01,8.93915810e-01,1.07989556e+00,5.86896942e-01, -// -1.29215475e+00,-5.39418488e-02,3.31662113e-01,1.85374966e+00,-8.91229000e-02, -// -1.41606419e+00,4.20339629e-01,-1.47274165e+00,1.95389833e+00,1.53342723e+00, -// -8.86445308e-01,-4.92584741e-01,-1.46519588e+00,-7.26665443e-01,3.09457152e-01, -// -8.27108383e-01,1.29892037e-01,1.52628274e+00,-1.74933140e+00,3.57862061e-01, -// 1.45490050e+00,1.01253906e+00,-5.04476506e-01,3.77443444e-01,-7.83348783e-01, -// -7.51759327e-01,-8.45699088e-01,1.37727665e+00,1.37182901e+00,-1.10613242e+00, -// 1.51293664e+00,1.80365701e+00,1.96864895e+00,1.54998488e+00,-1.07411407e+00, -// 1.90001975e+00,-9.89447080e-01,-3.95315948e-02,5.70366375e-01,1.77403158e+00, -// -1.96587188e+00,7.60355039e-01,1.05451927e+00,-8.57880221e-01,-1.47770703e-01, -// 1.02707826e+00,-1.48945316e+00,-7.39360673e-01,7.62218079e-01,-1.53702244e+00, -// 5.02813144e-01,-1.11044245e+00,-1.96291845e+00,1.38805354e+00,1.84899925e+00, -// 9.77881665e-01,8.49562835e-01,1.36055199e+00,1.75583153e+00,-1.56686110e+00, -// 1.81076383e-01,-1.80111691e+00,7.54248654e-01,-1.19391673e-01,-1.77136727e+00, -// -1.26624481e+00,1.37289543e+00,-3.93880483e-01,6.32055084e-02,1.66942482e-01, -// 1.67559646e+00,5.78540271e-01,4.37721595e-02,-2.08992696e-02,-1.32696247e+00, -// -1.68650608e+00,-4.63817805e-01,-2.68175039e-01,1.61943699e+00,1.70914008e+00, -// -1.91654576e+00,-1.21558829e+00,-5.05333138e-01,-1.66447501e+00,-1.02046566e+00, -// 1.24130795e+00,-1.69239008e+00,-1.14066571e+00,4.46448584e-01,-2.93925772e-01, -// 1.07505427e+00,-1.74237430e+00,-1.63797294e+00,1.63088723e+00,8.10796381e-02, -// 7.91805953e-01,-2.34409604e-01,-6.39194505e-01,-6.87194679e-02,1.75686306e+00, -// 1.33916582e+00,9.75681967e-01,2.79194761e-01,3.40890906e-01,2.45148021e-01, -// 8.00802733e-01,6.95877732e-01,-2.68975998e-01,1.89874977e+00,-1.91074558e+00, -// 1.97101138e-01,3.69494738e-01,-2.74295858e-01,1.03661529e+00,-1.97555715e-01, -// -8.97915918e-01,-1.08051540e+00,-4.85937129e-02,1.71182642e+00,1.09837125e+00, -// -1.65255931e+00,1.53945962e+00,-1.13072200e+00,1.48280367e+00,6.82845431e-01, -// 2.37465296e-01,-3.41238538e-01,1.50861546e+00,-5.83664946e-01,-1.74839663e+00, -// -2.47620387e-01,-6.82841191e-02,1.98463735e+00,-7.04105664e-01,-1.33988626e+00, -// -1.65119057e+00,-1.65795118e+00,-6.36447004e-01,9.68132715e-01,-1.41310081e+00, -// -3.55961200e-01, -// }; -// k2c_tensor test1_input_1_input = {&test1_input_1_input_array[0],2,256,{ 8,32, 1, 1, 1}}; -// float keras_dense_3_test1_array[30] = { -// -3.41202229e-01,-3.40328246e-01,-3.38212341e-01,-3.34918261e-01,-3.31133306e-01, -// -3.26770037e-01,-3.22528869e-01,-3.18505883e-01,-3.15485924e-01,-3.13531458e-01, -// -3.12333912e-01,-3.11826408e-01,-3.12643707e-01,-3.14953268e-01,-3.23638350e-01, -// -3.25902432e-01,-3.17387879e-01,-3.07023823e-01,-2.93167263e-01,-2.73203939e-01, -// -2.45509386e-01,-2.31976539e-01,-2.25736469e-01,-2.26480037e-01,-2.33157605e-01, -// -2.39988565e-01,-2.39499211e-01,-2.28820696e-01,-2.11166322e-01,-1.85300931e-01, -// }; -// k2c_tensor keras_dense_3_test1 = {&keras_dense_3_test1_array[0],1,30,{30, 1, 1, 1, 1}}; -// float c_dense_3_test1_array[30] = {0}; -// k2c_tensor c_dense_3_test1 = {&c_dense_3_test1_array[0],1,30,{30, 1, 1, 1, 1}}; -// float test2_input_1_input_array[256] = { -// 2.37830367e-01,-1.94470877e+00,1.72811583e+00,-1.45306488e+00,-1.23660600e+00, -// 1.69552117e+00,1.56978651e+00,1.15628601e+00,-1.86457134e+00,-1.67459149e+00, -// -9.20231028e-01,-1.89177953e+00,-1.23646173e+00,1.18188686e+00,-1.21608412e+00, -// 1.01440456e+00,9.06408957e-01,5.48323252e-02,-4.06419495e-01,2.63032685e-02, -// -1.22647534e+00,-8.40684657e-02,1.01707195e+00,-1.42786722e-01,-1.47320418e+00, -// -6.89262414e-01,-3.55764582e-01,6.95575778e-01,-9.94605972e-01,-1.98041639e+00, -// -1.32201732e+00,1.55995578e+00,8.77827989e-01,-1.22672820e+00,1.48288703e+00, -// -6.36260148e-01,1.73957654e+00,4.97389645e-01,-1.04389031e+00,-8.16330791e-01, -// 1.51829906e+00,-1.70251146e+00,-9.30338187e-01,-1.20780805e+00,-1.35361337e+00, -// -1.53720889e+00,1.73838471e+00,-1.55333896e+00,-3.44643282e-01,-1.39206437e+00, -// 1.92139232e+00,1.02843648e+00,-1.11631108e+00,8.76607159e-01,1.70893142e+00, -// 1.88689923e+00,-9.03163783e-01,-4.82687688e-01,3.90571758e-01,-8.37537542e-03, -// -1.20914711e+00,1.04738016e+00,-6.49340941e-01,-1.19851232e+00,-1.09729627e+00, -// 1.01362327e+00,-8.68987063e-01,-2.23599505e-01,8.72361245e-02,1.71054762e+00, -// -5.47321261e-02,-4.14303480e-01,1.53394966e+00,-4.82741402e-02,-1.81252218e+00, -// -3.17551473e-01,-9.08210170e-01,5.85952016e-01,-5.99916954e-01,1.67154650e+00, -// -1.98332590e+00,4.36386088e-01,-5.11241795e-02,-9.83424244e-01,1.37186420e+00, -// -9.37362117e-01,-3.05942543e-01,-6.68879463e-01,-1.74669967e+00,1.93639716e+00, -// 1.55257694e+00,1.16889978e-01,-7.39003644e-01,-1.28121396e+00,-5.94040331e-01, -// 1.06604002e+00,-4.99120098e-01,7.29892898e-01,1.60168126e-01,-9.74108844e-01, -// 4.34607823e-01,-1.28054980e+00,-4.74522847e-03,-2.03416191e-01,1.25313682e+00, -// -1.91763443e+00,5.35452008e-01,-1.69771236e+00,-2.53211428e-01,-1.96137540e-01, -// 6.28766362e-02,-4.38548137e-01,-1.37460522e+00,1.39857289e+00,1.46403937e-01, -// -1.52860809e+00,-1.01542005e+00,1.18682753e+00,5.42892021e-01,-2.97861884e-01, -// 6.88928403e-01,8.61156993e-01,9.48875181e-01,7.74269837e-02,1.21980232e+00, -// -3.31742665e-01,7.38852420e-01,7.10774530e-01,3.73018031e-02,-1.60397075e+00, -// 1.19816269e-01,3.51368716e-03,-3.49056464e-01,-1.73996745e+00,1.84129230e+00, -// -3.54067635e-01,7.40961717e-01,-1.62004747e+00,7.33703593e-01,-9.02539652e-01, -// 1.72747249e+00,1.28207169e+00,1.41970292e+00,1.97355319e+00,1.48317477e+00, -// -5.87427826e-01,-2.96994703e-01,-1.19487511e+00,-1.23918817e+00,4.92258171e-01, -// 1.66742133e+00,1.47978105e+00,-6.65381720e-01,-1.37528669e+00,4.83075715e-01, -// -1.31331231e+00,6.99718097e-01,-2.71911937e-01,-5.58007147e-02,-7.87310985e-01, -// -1.56116738e+00,1.86724611e-02,2.55101112e-01,7.45538522e-01,5.19814595e-01, -// 6.30234049e-01,-1.90399530e+00,4.36725914e-01,1.55012183e+00,2.06143462e-01, -// 1.67584123e+00,1.58704087e+00,-9.40321870e-01,-5.08069908e-01,6.47087343e-01, -// 5.43599077e-01,-5.93401667e-01,-1.76683459e+00,-1.74979057e+00,1.69819511e+00, -// 3.92487221e-01,8.15617957e-01,-1.36160304e+00,-4.83958560e-01,-1.40085767e+00, -// 4.68212644e-01,-1.95554390e-01,-1.35089126e+00,-1.98377506e-01,1.98641351e+00, -// 1.93120560e-01,9.62154528e-01,-1.58937984e+00,2.21535509e-01,-1.32442800e+00, -// 2.00693909e-01,-5.46493035e-01,-3.90326775e-01,1.47746301e+00,1.85257506e+00, -// 2.83355449e-02,-3.23142680e-01,-1.13714169e+00,-8.22175544e-01,-1.83396959e+00, -// 1.17888416e+00,-1.58039614e+00,-5.07817238e-01,1.94331949e+00,1.50930506e+00, -// -1.56956415e+00,-5.29425127e-01,2.07108404e-01,-8.10582352e-01,-7.36060638e-01, -// 3.99771546e-01,-7.01472972e-01,7.04615951e-01,2.42997371e-01,3.70230236e-01, -// -8.99305207e-01,1.41153463e+00,-5.23796904e-01,-3.94061507e-01,1.07828687e-01, -// -1.82145094e-01,-7.94003754e-01,-1.90538531e+00,-5.33254186e-02,1.88346742e+00, -// 2.53949200e-01,-1.96102330e+00,6.44349254e-02,1.47342778e-01,-5.14250510e-01, -// -1.00730334e+00,-1.60391935e+00,-1.41200439e+00,1.12860870e-01,-1.81695794e+00, -// -4.23776341e-02,7.30974051e-01,-1.65491333e+00,-7.16560355e-01,7.61685440e-01, -// 2.75296210e-01,-1.39334512e-01,1.35524981e+00,-1.80254697e+00,-4.43021753e-01, -// -1.36271871e-01,1.86408806e+00,1.58307736e+00,3.40736364e-01,1.44533654e-01, -// 1.25983315e+00, -// }; -// k2c_tensor test2_input_1_input = {&test2_input_1_input_array[0],2,256,{ 8,32, 1, 1, 1}}; -// float keras_dense_3_test2_array[30] = { -// -6.15083277e-01,-6.28950834e-01,-6.68324649e-01,-7.28432953e-01,-8.05854023e-01, -// -9.01521564e-01,-1.00461674e+00,-1.10337079e+00,-1.18144989e+00,-1.23168278e+00, -// -1.26228416e+00,-1.28076565e+00,-1.28205073e+00,-1.25219011e+00,-1.15394747e+00, -// -8.70441794e-01,-7.78388739e-01,-6.66538298e-01,-5.47695220e-01,-4.47268695e-01, -// -3.84141237e-01,-3.71753275e-01,-3.76685530e-01,-4.25222546e-01,-4.88246918e-01, -// -5.44550717e-01,-5.96078992e-01,-6.35130167e-01,-6.59909129e-01,-7.01359630e-01, -// }; -// k2c_tensor keras_dense_3_test2 = {&keras_dense_3_test2_array[0],1,30,{30, 1, 1, 1, 1}}; -// float c_dense_3_test2_array[30] = {0}; -// k2c_tensor c_dense_3_test2 = {&c_dense_3_test2_array[0],1,30,{30, 1, 1, 1, 1}}; -// float test3_input_1_input_array[256] = { -// 8.13039024e-01,1.35338887e+00,1.16590713e+00,-1.56607175e+00,1.83999723e+00, -// 1.07080312e+00,-3.01011421e-01,-1.96576299e+00,-1.29152312e-01,-1.46012516e+00, -// 1.53344846e+00,3.89835673e-01,-1.97337770e+00,-1.04441625e+00,1.59960324e+00, -// -1.26861347e+00,-1.59790915e+00,-3.09105100e-01,-9.77704193e-01,-1.00977666e+00, -// 5.68408575e-01,1.99417855e+00,-1.08073882e+00,-1.46509498e+00,-8.58840619e-01, -// 1.28954082e+00,9.78122139e-02,1.01765155e+00,-6.35141725e-01,-6.05912719e-01, -// -8.48033277e-01,-6.72534161e-02,8.63263756e-01,-3.45116772e-01,1.87633064e-02, -// 1.25270636e+00,-1.97618108e-01,1.33028795e+00,1.99601483e+00,-1.28035543e+00, -// -2.25729906e-01,1.77027526e-01,1.01420963e+00,-1.88789170e+00,-1.16094688e+00, -// -2.81656573e-01,8.74093878e-01,6.38677749e-01,4.25072406e-01,1.69426496e+00, -// 3.38153529e-01,-1.32609292e+00,-1.11325132e+00,1.03719541e+00,-1.70312478e+00, -// -9.13277083e-01,3.25413874e-01,9.23993229e-01,-1.55922400e+00,-1.04068837e-01, -// -1.59956610e+00,1.61005536e+00,8.86553382e-01,1.52108601e+00,-4.44132284e-01, -// 1.53225780e+00,-1.88896067e+00,9.06836454e-02,7.31467524e-01,1.30067877e-01, -// 7.41515062e-02,-8.12050703e-02,9.46675746e-01,-1.17316417e+00,-8.49878127e-01, -// -1.01730899e+00,-1.66441908e+00,1.93335734e+00,1.31483464e+00,1.68438377e+00, -// -1.20221370e+00,-3.94005549e-01,-1.05113626e+00,1.14201817e+00,-2.75097043e-01, -// -4.86244948e-01,8.95258933e-01,-1.50501043e+00,1.02059263e+00,5.89379351e-01, -// -2.59855360e-01,1.47496317e+00,-1.44350230e+00,-1.20449662e+00,8.61668332e-01, -// -8.52787581e-01,4.63852057e-01,-8.16152732e-01,-6.41745611e-01,-8.15680556e-01, -// 6.98657966e-01,-1.56959997e+00,-1.18670829e+00,-2.19330687e-01,-4.71946736e-01, -// -1.37159360e-01,9.04064590e-01,-1.67288095e+00,-3.77661737e-01,3.19203792e-01, -// -5.77716725e-01,-1.70246285e+00,-1.33113255e+00,1.67247014e+00,-8.23817664e-01, -// -1.18141077e+00,4.51457117e-01,5.32450240e-01,-9.59108173e-01,1.66604818e+00, -// -4.94743461e-01,-8.52230593e-01,-1.88769337e-01,-1.40807020e+00,4.44067953e-01, -// 1.80744401e+00,-8.74249782e-01,-8.87828130e-01,8.95439784e-02,1.34256254e+00, -// -7.41120737e-01,-2.36979642e-01,-1.77564118e+00,-1.62026928e+00,1.96535034e+00, -// 2.65489885e-01,4.00489438e-01,-5.74300185e-01,1.61287092e+00,1.50096763e+00, -// -1.00067130e+00,-7.40220590e-01,-1.35067536e+00,-1.72622746e+00,3.62736682e-01, -// -1.16756223e+00,-8.46781820e-01,7.17710425e-01,-8.77631438e-01,6.27593776e-02, -// -8.50192294e-01,9.20957408e-02,-1.38983754e+00,7.81933830e-01,4.21937115e-01, -// -1.89262526e+00,1.26304988e-01,1.59964681e+00,-1.33119920e+00,2.28769405e-01, -// -1.15217269e+00,1.36298463e+00,-9.49542011e-01,-1.02824264e+00,1.14649913e+00, -// -1.33842249e+00,6.57588315e-01,-1.76220610e+00,-1.03125739e-01,-1.80594238e+00, -// -1.45646844e+00,1.84969660e+00,3.25575886e-01,1.45717502e+00,-1.30282496e+00, -// 3.12685132e-01,-4.49044107e-02,-1.89960661e+00,-7.35643180e-01,1.34247491e+00, -// -6.87063410e-01,2.50604451e-01,2.67793244e-01,-5.28379936e-01,-8.25074269e-01, -// -5.63203744e-01,1.77311879e+00,-1.02515397e-01,-1.95200932e+00,-1.31118828e+00, -// 1.18719564e+00,-1.10180753e+00,1.27847772e+00,-5.77607041e-01,-8.56176844e-01, -// 1.63545401e-01,-9.19305695e-01,1.10665046e+00,1.25544818e+00,-2.58297233e-01, -// -1.33607861e+00,-3.59309168e-01,-1.19574053e+00,-7.44684405e-01,-4.58305415e-01, -// -2.43618207e-01,-1.28243522e+00,8.83065540e-01,-8.64987684e-01,1.28308207e-01, -// 9.28404980e-01,-2.75281587e-02,8.49817089e-01,-1.53324993e+00,-1.89694490e+00, -// 1.14206998e+00,5.37111832e-01,-1.89435558e+00,-1.63501093e+00,3.03838872e-01, -// 2.66359312e-01,8.48518235e-01,1.66480300e+00,-2.65905590e-01,-3.54325448e-01, -// -1.25291218e+00,-6.10612832e-01,1.41612393e+00,3.56889325e-01,-1.63896425e+00, -// 1.50448311e+00,-1.46172291e+00,-1.10037051e+00,1.42241906e+00,9.97953074e-01, -// 2.49171296e-01,-1.16011890e+00,-8.09908371e-01,-2.19075830e-01,1.49303090e+00, -// 1.12303065e+00,-1.37080667e+00,-1.16500851e+00,3.85517187e-01,-5.59330191e-01, -// -9.89710295e-01,-2.18594852e-01,-1.47384737e+00,6.95429021e-01,-1.76201522e+00, -// 9.76836250e-01,-1.35323563e-01,1.83624375e+00,1.88792990e+00,-1.13471618e+00, -// 1.48767070e+00, -// }; -// k2c_tensor test3_input_1_input = {&test3_input_1_input_array[0],2,256,{ 8,32, 1, 1, 1}}; -// float keras_dense_3_test3_array[30] = { -// -3.74050379e-01,-3.75598013e-01,-3.79889280e-01,-3.86666059e-01,-3.95905137e-01, -// -4.06267256e-01,-4.17957813e-01,-4.29430127e-01,-4.38792676e-01,-4.44469392e-01, -// -4.47561294e-01,-4.48685586e-01,-4.48135346e-01,-4.45252270e-01,-4.42945629e-01, -// -3.97110492e-01,-3.65418464e-01,-3.21212023e-01,-2.62374580e-01,-1.89959735e-01, -// -1.08477198e-01,-6.69150949e-02,-3.41675207e-02,-8.90460983e-03,7.35446438e-03, -// 1.76779814e-02,2.76235864e-02,3.40030938e-02,3.19767147e-02,2.06816122e-02, -// }; -// k2c_tensor keras_dense_3_test3 = {&keras_dense_3_test3_array[0],1,30,{30, 1, 1, 1, 1}}; -// float c_dense_3_test3_array[30] = {0}; -// k2c_tensor c_dense_3_test3 = {&c_dense_3_test3_array[0],1,30,{30, 1, 1, 1, 1}}; -// float test4_input_1_input_array[256] = { -// 2.78744796e-01,-2.12990829e-01,-3.39089416e-01,-1.70105700e+00,6.11497553e-01, -// 1.11016930e+00,1.02995026e+00,-1.62691106e+00,-1.70873610e-01,-1.58336075e+00, -// 1.08734452e+00,6.22674220e-01,5.98216304e-01,-1.14442499e+00,-1.31417915e+00, -// -5.54246060e-01,-6.25189623e-01,1.07018378e+00,-5.45431510e-01,1.15731623e+00, -// 8.34874212e-01,-9.10242984e-01,-1.78419647e+00,-7.84417912e-01,-4.93021539e-01, -// -1.24652441e+00,-3.72597496e-01,-6.51338243e-01,1.43666518e-01,8.35946621e-01, -// -1.09264733e+00,-1.64108211e+00,1.19554470e+00,1.19753459e+00,-6.58632167e-01, -// -1.08626062e+00,1.14666096e+00,3.63683298e-01,-1.77773313e+00,-6.56116986e-01, -// -1.00303576e+00,1.71343122e-01,-6.52892977e-01,1.47877029e+00,-6.93513917e-01, -// 1.69630038e+00,5.24412612e-01,1.96388039e-01,1.27649615e+00,-8.03892817e-01, -// -6.64897794e-01,-1.66860596e+00,-1.06067189e+00,1.08650469e+00,-7.25000211e-01, -// -1.12971872e+00,9.64174295e-01,1.44714145e+00,-1.43412676e+00,7.20275542e-01, -// -6.27735477e-01,1.11926330e-01,9.22153054e-01,-1.61385010e+00,1.86139883e+00, -// -4.71449695e-01,-1.95311110e+00,2.53528774e-01,2.97489321e-01,5.48437767e-01, -// 1.47128259e+00,-2.98197828e-01,-1.38905832e+00,-1.49368842e+00,-3.87657443e-01, -// 1.79829088e+00,-1.66193390e+00,1.26869135e+00,-6.16315093e-01,-2.91902342e-02, -// -1.26996257e+00,-1.87452417e+00,1.70787561e+00,1.31955979e+00,-1.01785757e+00, -// -7.41800672e-02,-9.91075944e-01,7.71865925e-01,1.85405623e+00,-9.08535548e-01, -// -1.70379703e+00,-1.13036069e+00,1.85272142e+00,-8.12886907e-01,1.27656116e+00, -// -1.63682247e+00,1.11322001e+00,1.46618340e+00,1.75635876e+00,-8.02125156e-01, -// -1.16300519e+00,-7.62453332e-01,-3.07356071e-01,1.28790006e+00,1.51003747e+00, -// -3.08190026e-01,2.30745362e-01,1.58389358e+00,-8.85689679e-01,1.38453475e+00, -// 4.84907096e-01,5.82786383e-01,1.10013991e+00,7.08082665e-01,9.08442149e-02, -// 1.38660749e-01,-7.33231028e-02,8.71956321e-01,1.12710765e+00,3.44768464e-01, -// 2.21764009e-01,-1.33630070e+00,-1.90030954e+00,1.60511423e+00,-1.22596700e+00, -// 6.93250252e-01,1.40830083e+00,-1.64863878e+00,-1.75404467e+00,1.85043726e+00, -// -8.04481104e-01,1.29852098e+00,8.45785339e-01,1.85503931e+00,-4.69609741e-01, -// 1.17347671e+00,-1.84411112e+00,5.55733519e-01,-1.91657917e+00,-8.91146758e-01, -// 2.87000119e-01,5.32948490e-01,-1.22750167e+00,3.42099386e-01,2.12681427e-01, -// -1.54318464e+00,-1.88268930e+00,9.54522013e-01,8.05598229e-01,-3.17473895e-01, -// 1.62637725e+00,7.55881923e-02,-1.35821108e+00,1.69094008e+00,-2.75936417e-01, -// -8.27439933e-01,-1.71586673e+00,-7.91451003e-01,1.46022407e+00,3.46111721e-01, -// -1.36795182e-01,-6.96033691e-01,-1.36399761e+00,-7.98877617e-01,1.50021990e+00, -// -1.26722958e+00,-2.57104027e-01,-1.85620744e+00,1.05533697e+00,-4.09108039e-01, -// -4.57978341e-01,1.35301522e+00,-1.45571585e+00,1.87544997e+00,-1.91579272e+00, -// 6.07040470e-01,9.80554901e-03,1.04666345e+00,1.82496170e-02,-1.94763170e+00, -// 1.22676217e+00,-1.79703838e+00,-1.81228805e+00,6.91525507e-01,-3.74179716e-01, -// 3.23254664e-01,5.95550032e-01,-1.34418952e+00,-4.43543238e-01,4.86921321e-01, -// 2.39835664e-01,8.56268113e-01,1.70490771e+00,-8.34515195e-01,-1.36556343e+00, -// 1.04163729e+00,-3.14691687e-01,-8.76588092e-01,1.60662998e+00,-1.56215656e+00, -// 3.44083458e-01,1.39884932e+00,-1.65686504e+00,9.24042283e-02,3.44606596e-01, -// -3.73863642e-01,5.82540075e-01,-9.98634727e-01,-3.26180066e-01,-7.37231569e-01, -// -1.81791939e+00,-1.84903475e+00,-1.37172549e+00,-1.77350860e+00,1.08812568e+00, -// 1.61543613e+00,1.59969856e+00,1.39677878e+00,1.21081397e+00,-1.70669469e+00, -// 1.91413575e-01,7.03716083e-01,-8.09117954e-01,5.46237035e-01,-5.10723259e-02, -// 6.19356467e-01,-1.78767306e+00,1.99739841e+00,-1.13906963e+00,-1.30514934e+00, -// 1.38178850e+00,-7.77088199e-01,1.21948707e+00,-8.12808540e-02,8.01039612e-01, -// 9.06544868e-01,4.29653284e-01,1.09653131e+00,-1.36541446e+00,-1.38503434e-01, -// -5.27372885e-01,1.00963007e+00,-1.47753758e+00,2.00459751e-01,-3.11706267e-01, -// -3.87187339e-01,1.11652255e+00,-1.28820470e+00,-8.11790955e-01,-1.84966481e+00, -// -3.74623576e-01,1.83636712e+00,8.12106682e-01,7.31290627e-01,7.02890051e-01, -// 3.84177575e-01, -// }; -// k2c_tensor test4_input_1_input = {&test4_input_1_input_array[0],2,256,{ 8,32, 1, 1, 1}}; -// float keras_dense_3_test4_array[30] = { -// -1.69013172e-01,-1.68039277e-01,-1.64795205e-01,-1.60253957e-01,-1.54899254e-01, -// -1.46449208e-01,-1.38085485e-01,-1.30052507e-01,-1.22201502e-01,-1.15449615e-01, -// -1.10443197e-01,-1.07350655e-01,-1.07944548e-01,-1.13103926e-01,-1.25865012e-01, -// -9.50514749e-02,-6.69159815e-02,-2.58669686e-02,3.37457508e-02,1.12619348e-01, -// 2.03693062e-01,2.51116961e-01,2.89936274e-01,3.32557976e-01,3.68795037e-01, -// 3.96790922e-01,4.24174428e-01,4.35641110e-01,4.16474760e-01,3.66044015e-01, -// }; -// k2c_tensor keras_dense_3_test4 = {&keras_dense_3_test4_array[0],1,30,{30, 1, 1, 1, 1}}; -// float c_dense_3_test4_array[30] = {0}; -// k2c_tensor c_dense_3_test4 = {&c_dense_3_test4_array[0],1,30,{30, 1, 1, 1, 1}}; -// float test5_input_1_input_array[256] = { -// 1.90370200e+00,-1.53258013e-01,3.36083674e-01,-1.78192327e+00,1.44751771e+00, -// 1.81134316e+00,-1.84705127e-01,-6.50586423e-01,-1.48715721e+00,-1.10811242e+00, -// -1.63366312e+00,5.49387876e-01,1.93805750e+00,1.30691603e+00,-7.97616332e-02, -// -1.04868775e+00,1.03361878e+00,-9.42422101e-02,-1.47179595e-01,-1.07645946e+00, -// -8.49778002e-01,1.58208751e-01,-1.83818758e-01,-2.19286885e-01,1.74974685e+00, -// 1.96281798e+00,8.14942071e-01,-2.45620291e-01,-1.70050082e+00,1.89628945e+00, -// -1.83497396e+00,-1.64457118e+00,1.30918048e+00,-1.41688573e+00,1.25503805e+00, -// -1.28009508e+00,-9.46670246e-01,-1.49314114e+00,1.73995643e+00,-3.79229016e-01, -// -1.27522359e+00,-1.16740351e+00,-3.50181536e-01,-1.22069937e+00,-3.83060919e-01, -// 5.13593461e-01,1.10786656e+00,5.10330714e-01,1.22293756e+00,-8.46349159e-01, -// 4.41929704e-01,-2.18583156e-01,1.26461816e+00,-1.62938969e+00,9.87494428e-01, -// 1.60780900e+00,1.21304474e-01,7.85465105e-01,1.99997166e+00,-1.30122517e+00, -// -1.85509309e+00,-6.89659823e-01,1.59417556e+00,-1.52441266e+00,9.75161073e-01, -// -1.60541657e+00,-1.73454928e+00,-1.43221287e+00,8.47685514e-01,9.73979468e-01, -// -1.11281745e+00,-1.06408483e+00,1.82778091e+00,-1.75470513e-01,-1.52163044e-01, -// -1.42903188e+00,-5.56474511e-01,-9.43473472e-01,1.65606136e+00,-1.48702047e-01, -// 1.75914085e+00,1.76340756e+00,1.24191866e+00,-8.02149013e-01,-5.10788522e-01, -// 1.05629103e+00,-1.98765563e+00,-5.66387489e-01,-1.38462688e+00,-8.38874663e-02, -// 1.21655051e+00,-8.28593871e-01,-1.20522166e+00,-1.66787543e+00,-1.68508659e-01, -// 1.63498295e+00,3.70232502e-01,1.23864194e+00,1.47695849e+00,8.35587235e-01, -// -3.85929479e-01,-5.47074265e-02,7.77159254e-01,2.79590041e-01,-1.08276679e-01, -// -7.14356590e-01,1.61707658e+00,-3.53132845e-01,-1.90253314e+00,3.40881162e-01, -// 1.78441182e+00,-1.65590261e+00,-1.28821572e+00,1.17443380e+00,2.12614240e-01, -// 7.30543209e-01,-7.43411356e-01,-1.70904311e+00,3.99658704e-01,-1.62982393e+00, -// 1.85083665e-01,-1.22357509e+00,-1.30572294e+00,-1.50994534e+00,4.31978314e-01, -// 1.81740487e+00,2.64455536e-01,-1.10051929e+00,-9.88388391e-01,7.67716045e-01, -// 4.39791271e-01,-7.82011359e-01,-1.08105249e+00,-1.05360916e-01,-4.68897145e-01, -// -7.87930621e-01,-1.34949589e+00,-1.27925869e+00,-1.51971630e+00,1.39174279e+00, -// 5.56456423e-01,1.53045585e+00,1.02169004e+00,-1.70418326e+00,-5.04831843e-01, -// -1.85395943e+00,-1.62270298e+00,5.96880587e-02,1.53902121e+00,-2.05592180e-01, -// 5.76965746e-01,3.45864699e-01,9.39295933e-01,-7.86663649e-01,1.40881647e+00, -// 4.19437106e-01,6.34134780e-01,-1.09665858e+00,1.71146523e+00,-1.90323271e+00, -// 6.35900134e-01,4.56887800e-01,4.79053022e-01,1.88166120e+00,-6.94624166e-01, -// -1.36612802e+00,1.23187484e-01,-1.53221784e+00,1.68312190e-01,1.82543914e+00, -// -1.92568899e+00,2.99397608e-01,5.02038490e-01,-1.14415311e+00,1.05578121e+00, -// 1.26289625e+00,-5.71640227e-01,8.02969037e-01,-1.18446500e+00,1.91830944e-01, -// -1.94776100e+00,1.08706424e+00,1.04883688e+00,-1.44951066e+00,-6.31706204e-01, -// -5.57508494e-01,-4.73452453e-01,-1.60642354e+00,5.32065627e-01,1.19266628e+00, -// -1.23897524e+00,-6.05695326e-01,1.53642049e-01,-3.68657587e-01,-1.87098419e+00, -// -1.12783718e+00,-1.67668845e+00,1.98137379e+00,1.35881186e-01,-7.78976774e-01, -// -5.55940663e-01,-9.80552524e-02,-9.24192013e-01,9.76252545e-01,-5.56645016e-01, -// -4.18110055e-01,-1.35905127e+00,4.25447042e-01,1.32830879e+00,3.18883409e-01, -// -1.05688863e+00,1.36633478e-02,3.29888993e-02,1.42377177e+00,1.83303021e+00, -// -1.48593451e+00,1.30142396e+00,-1.22954254e+00,1.08830243e-01,-1.63238401e-01, -// -1.04008268e-01,4.43524092e-01,4.93448839e-02,1.15368006e+00,1.13841458e+00, -// 1.18078748e+00,-1.01114372e-01,8.88238474e-01,-9.93228767e-01,6.21815362e-01, -// -6.51214494e-01,-1.69439282e+00,1.63473638e+00,-1.39656980e+00,1.77399600e+00, -// -1.34742491e+00,-1.52731759e+00,2.90369496e-01,8.54056932e-01,1.49062740e-01, -// -6.84844535e-01,-4.63272454e-01,3.30397591e-01,-6.38562365e-01,-4.42622690e-01, -// -1.36152137e+00,1.47215976e+00,-1.25786878e+00,-1.04619694e+00,2.83182475e-03, -// -2.39572720e-01,6.03319800e-01,9.25192145e-01,3.49558557e-01,1.22593033e+00, -// -1.77038718e+00, -// }; -// k2c_tensor test5_input_1_input = {&test5_input_1_input_array[0],2,256,{ 8,32, 1, 1, 1}}; -// float keras_dense_3_test5_array[30] = { -// -1.78253725e-01,-1.85563102e-01,-2.06439510e-01,-2.38346770e-01,-2.79753268e-01, -// -3.31043929e-01,-3.86677444e-01,-4.40076560e-01,-4.81740981e-01,-5.07695436e-01, -// -5.22967219e-01,-5.31750143e-01,-5.31199396e-01,-5.13638020e-01,-4.54672903e-01, -// -2.72064298e-01,-2.13303238e-01,-1.42183349e-01,-6.65008873e-02,-3.60757671e-03, -// 2.84197927e-02,2.81561296e-02,1.43332407e-02,-2.43935920e-02,-7.46993124e-02, -// -1.26414627e-01,-1.79188639e-01,-2.28332058e-01,-2.71644384e-01,-3.20908159e-01, -// }; -// k2c_tensor keras_dense_3_test5 = {&keras_dense_3_test5_array[0],1,30,{30, 1, 1, 1, 1}}; -// float c_dense_3_test5_array[30] = {0}; -// k2c_tensor c_dense_3_test5 = {&c_dense_3_test5_array[0],1,30,{30, 1, 1, 1, 1}}; -// float test6_input_1_input_array[256] = { -// 8.01857854e-01,1.37581938e+00,4.58132847e-01,-9.46377837e-01,-8.68302419e-01, -// 5.03514925e-01,1.23786292e+00,1.32136807e+00,-1.49713164e+00,-1.20234651e+00, -// 1.50151658e+00,6.27050786e-01,-1.08118301e+00,-1.41439495e+00,-4.97662299e-01, -// -6.27682037e-02,-1.31162305e+00,-1.12995643e+00,7.94266549e-01,1.36830541e+00, -// -1.82762187e+00,-9.40840748e-01,7.91751915e-01,-1.29465110e+00,-5.79326699e-01, -// 6.56374075e-01,-1.86687105e+00,1.12821929e+00,-1.29121693e+00,-9.49934259e-01, -// -1.55091871e+00,-2.89786162e-01,-1.69426691e+00,-3.59889268e-02,-1.08850944e+00, -// -1.25308990e+00,1.24710333e-01,-1.58498493e+00,7.94900235e-01,-1.04727556e+00, -// -1.93554361e+00,-1.71067622e-01,-7.27065150e-02,-1.84394682e-01,1.28040400e+00, -// -1.09627391e+00,1.58569252e-01,1.96359024e+00,5.76189311e-02,1.60226286e+00, -// -3.46921115e-01,-1.81795229e+00,-1.94782516e+00,8.10143994e-02,-1.79545541e+00, -// 5.31659777e-01,9.67977901e-01,-1.84900263e+00,-7.24621590e-01,1.58114437e+00, -// 1.24376628e+00,3.50593395e-01,4.28463142e-01,-1.87965563e+00,-1.28138446e+00, -// 3.99621358e-01,-1.16987028e+00,-5.62677150e-01,9.06859043e-01,1.68028109e+00, -// -4.51369144e-01,7.39110426e-01,8.42846236e-02,-8.85514725e-01,-1.08998626e+00, -// -9.70353761e-01,5.90949614e-01,-1.03742810e+00,-9.92078363e-01,1.70089012e+00, -// -1.13792004e+00,6.53025185e-01,-6.28796772e-01,-2.24907216e-01,1.19772157e+00, -// 9.86567067e-01,-4.75239039e-02,5.17024752e-01,-1.50378715e+00,-1.39862294e+00, -// 6.25947799e-01,-1.29468287e+00,1.29819131e+00,-1.25669901e+00,-1.08806331e+00, -// -5.27018022e-01,-1.44496014e+00,3.12220749e-01,1.32873480e+00,1.98066555e+00, -// -1.91573545e+00,2.47430001e-01,-1.67634052e+00,6.98173138e-01,2.09726877e-01, -// -1.03786574e+00,-3.39617911e-01,1.44512561e+00,1.95281274e+00,-9.51779897e-01, -// -7.68399688e-01,-3.68851035e-01,-1.06107870e-01,1.38182216e+00,7.02265452e-01, -// -1.80778920e+00,1.03210648e+00,-9.07192477e-01,-1.35118163e+00,1.71622024e+00, -// -1.68238685e+00,-1.87647096e+00,-1.43243563e+00,2.80755755e-01,1.35220623e+00, -// 2.30182651e-01,-1.81319135e+00,9.38996581e-01,-1.09462679e+00,-1.11884200e+00, -// -1.72743217e-02,1.80027063e+00,-1.50873432e+00,1.45920980e+00,1.83590478e+00, -// -3.91231690e-01,1.32182840e+00,-7.19272611e-01,1.33680799e+00,-2.68835859e-01, -// 1.12125510e+00,6.52568104e-01,1.12842623e+00,-1.08022171e+00,9.83446478e-01, -// 1.85452671e+00,-4.35252984e-01,1.04272355e+00,-3.61643204e-01,6.70711332e-01, -// 1.93776808e+00,1.87881816e+00,1.57750807e+00,1.28566960e+00,9.45621344e-01, -// 9.85187354e-01,-2.32463747e-01,1.27952335e+00,-1.94876160e+00,-1.78713037e+00, -// -1.33040718e+00,1.33592627e-01,-3.24524792e-01,1.60088846e+00,-1.25136339e+00, -// -1.68985432e+00,-1.52029854e+00,-5.60670366e-01,6.59068093e-01,-1.70909663e+00, -// 5.55248419e-01,3.85652470e-01,4.36751211e-01,-1.21646742e+00,1.42961198e+00, -// -1.22159108e+00,1.01641769e+00,1.93389215e+00,9.75753285e-01,7.20231603e-01, -// -1.25388586e+00,1.35820695e+00,8.20605448e-01,-2.64335121e-01,-1.12561376e+00, -// 1.22248552e+00,-7.75056539e-02,1.06318505e+00,-2.99242176e-01,-1.27115006e+00, -// -1.28462600e+00,-1.42791663e+00,1.37044174e+00,-1.92228941e+00,1.42329515e+00, -// 1.53619695e+00,-1.42234525e+00,3.33957460e-03,9.91000737e-02,1.73656804e+00, -// 1.72399408e+00,3.05671792e-02,1.33518959e+00,1.55404238e+00,1.10928689e+00, -// 2.77509072e-01,-9.82479687e-01,2.19096496e-01,1.15249726e+00,7.77118049e-01, -// 1.93038053e+00,8.72417398e-01,1.19007164e+00,4.12550798e-01,-1.20651394e+00, -// -7.48178138e-01,7.34379805e-01,1.71847432e+00,1.84567420e+00,2.25159978e-01, -// 5.37809636e-01,5.37156491e-01,-6.07986992e-01,1.50619380e+00,-9.81578852e-01, -// -1.51571119e+00,6.28486678e-01,2.41442842e-01,1.19483415e+00,1.98354362e+00, -// -1.73818108e+00,6.92173298e-01,1.52150065e+00,-1.44026604e-02,-1.37931430e-01, -// -7.71066055e-01,-1.38365140e+00,1.19970264e+00,-6.54811517e-01,-2.90293800e-01, -// 1.89830467e+00,7.31916646e-01,1.35364106e+00,7.54876949e-01,8.92675490e-01, -// -1.16007713e-01,-7.46979330e-01,5.18860109e-02,9.69662186e-01,8.88390008e-01, -// -5.59998032e-01,-2.52953869e-02,1.08416548e+00,1.65404642e+00,-1.55309173e+00, -// -1.15820239e+00, -// }; -// k2c_tensor test6_input_1_input = {&test6_input_1_input_array[0],2,256,{ 8,32, 1, 1, 1}}; -// float keras_dense_3_test6_array[30] = { -// 4.17559206e-01,4.18111145e-01,4.19826686e-01,4.22122598e-01,4.24744815e-01, -// 4.27579045e-01,4.29389328e-01,4.29315984e-01,4.27252322e-01,4.23001915e-01, -// 4.17265952e-01,4.10933346e-01,4.04075325e-01,3.96032959e-01,3.90137076e-01, -// 4.17415082e-01,4.27639127e-01,4.39823389e-01,4.57058638e-01,4.77197289e-01, -// 4.89968240e-01,4.94471490e-01,4.99229163e-01,5.07801294e-01,5.16504407e-01, -// 5.20849526e-01,5.18585742e-01,5.01852393e-01,4.63444203e-01,4.01638925e-01, -// }; -// k2c_tensor keras_dense_3_test6 = {&keras_dense_3_test6_array[0],1,30,{30, 1, 1, 1, 1}}; -// float c_dense_3_test6_array[30] = {0}; -// k2c_tensor c_dense_3_test6 = {&c_dense_3_test6_array[0],1,30,{30, 1, 1, 1, 1}}; -// float test7_input_1_input_array[256] = { -// -1.29833873e-01,-3.98395959e-01,3.16309419e-01,1.25590115e+00,1.36511565e+00, -// 4.06806511e-01,1.04648509e+00,-1.20490057e+00,1.48371544e+00,-1.69672728e+00, -// 8.05380833e-01,-5.39316507e-01,-7.41851435e-01,1.16515868e+00,2.91216623e-02, -// -1.84435025e+00,5.76773438e-01,-9.38713852e-01,-1.07969597e+00,-1.81084465e-01, -// -9.16397333e-01,-1.13261414e+00,3.83345116e-01,-8.96480782e-02,5.12742583e-01, -// -7.13207670e-01,4.43070425e-01,-1.60937367e+00,-4.32660933e-02,-2.22948324e-01, -// 9.72247234e-01,1.57088483e+00,6.31433015e-01,-6.96560024e-02,7.98070973e-01, -// 8.87708739e-01,1.88268482e+00,-1.74157633e+00,-6.04525241e-01,1.79782057e+00, -// -1.78301245e+00,1.85607753e+00,-5.49036500e-01,-1.58351554e+00,8.55235107e-01, -// -1.64836353e+00,-1.00150177e+00,-1.05937324e+00,1.20863084e+00,3.37744433e-01, -// -6.75336157e-01,-3.31779818e-01,-8.85178240e-01,-1.50359525e+00,-7.90193876e-01, -// -5.42430599e-01,1.55050922e+00,-9.62848324e-01,-1.71188472e+00,-1.26741275e+00, -// -2.71782455e-01,-5.94610712e-01,-1.82045809e-03,-6.61709522e-01,3.62157181e-01, -// -7.39350118e-01,-6.93857160e-01,1.57555023e+00,1.25344029e+00,-2.12012344e-01, -// -1.79531569e+00,2.15575469e-01,-1.94444948e-01,-1.26743180e+00,1.83721419e+00, -// -4.96623093e-01,-1.89923349e+00,1.56770362e+00,-2.88697498e-01,1.27493139e+00, -// -1.43906351e+00,-5.94365236e-01,-2.43578518e-01,2.07180150e-01,-1.49330269e+00, -// 1.89965531e+00,1.20188097e+00,-1.04107701e+00,1.48590970e+00,9.86244675e-02, -// 1.35074782e+00,-6.78414750e-01,-1.60434730e+00,8.40263267e-01,8.84740053e-02, -// -1.63019606e+00,1.36230211e+00,1.65521797e+00,-1.02540788e+00,5.61880482e-01, -// -1.86406188e+00,-7.92954357e-01,1.93732820e+00,-6.79667028e-01,5.57687547e-01, -// -3.82475204e-01,-1.88471336e+00,-9.24861957e-01,8.42211080e-01,-1.20137647e-01, -// -9.65642534e-01,1.76275469e+00,5.68739892e-01,-5.49235213e-01,4.54721389e-01, -// 1.38666123e+00,-3.93876982e-01,6.83996690e-01,-1.94163883e+00,-1.79457071e+00, -// 8.25062924e-01,7.25049629e-01,-4.69319763e-01,-2.22043081e-01,-1.49559469e+00, -// 3.55733403e-02,-1.61363639e-01,8.06019469e-01,-5.50512107e-01,-8.76579484e-02, -// 2.71106976e-01,3.96098094e-01,-5.11449000e-01,-1.01105202e+00,5.75040478e-01, -// 6.08286724e-01,-8.22655289e-01,8.13834106e-01,5.89151830e-01,1.01154224e+00, -// 7.87866095e-01,-1.44501143e+00,-2.50123338e-02,-1.10582405e+00,1.46329946e+00, -// -1.58285083e+00,-1.61706815e-01,1.75649340e-01,9.41738386e-02,6.90337296e-01, -// 2.94903942e-01,-1.36752472e+00,-2.31188843e-01,1.79277987e+00,-3.63667229e-02, -// 1.34443515e+00,-1.37584088e+00,-4.77206291e-01,-1.96325536e+00,-1.03146229e+00, -// -1.60494057e+00,-1.07792006e+00,-6.23936485e-01,9.98718246e-01,1.72900584e+00, -// 6.35208399e-01,-5.53650000e-02,1.39282999e+00,8.86089780e-01,-1.52772743e+00, -// -6.44503425e-01,-6.14040729e-01,-1.07049903e-01,-1.18942418e+00,-2.40522391e-01, -// -9.23617506e-02,-8.84632325e-01,-1.23638366e+00,2.43979900e-01,-1.96481863e+00, -// 2.96008948e-02,1.78779080e+00,4.30857178e-01,1.63985544e+00,-1.09182496e+00, -// -8.57341593e-01,6.59751117e-01,4.38196868e-01,2.93804872e-01,-1.16126497e+00, -// -2.29610537e-01,-1.01298947e+00,1.08724846e+00,-8.58150375e-01,7.97826462e-01, -// -4.13476441e-01,-1.65182385e+00,-2.69848542e-01,1.42965774e+00,1.35544831e+00, -// -1.64277929e+00,8.17147902e-01,8.93149932e-01,-8.12068457e-01,-1.46637316e+00, -// -1.21173386e+00,1.36424419e+00,-4.78638713e-01,-1.30798596e+00,-1.57910938e+00, -// 1.93169660e-01,5.03166611e-01,-1.40683095e+00,1.55389225e+00,-9.80155120e-01, -// -8.99944251e-01,-6.94400264e-01,-1.63432659e+00,-1.43158586e+00,-1.87275705e+00, -// 1.28920509e+00,-1.88663903e+00,-1.96132477e+00,1.89670464e+00,1.90228357e+00, -// 1.72170073e+00,1.47098657e+00,3.08033989e-01,-1.93464901e+00,1.68246043e-02, -// 1.53958239e+00,-8.04585349e-01,-2.24145781e-01,-1.56661034e+00,-1.54342907e+00, -// -2.56669776e-01,8.97138782e-01,-6.45745282e-01,1.05793663e+00,1.52794883e+00, -// 3.75362384e-01,-9.00605530e-01,6.26779157e-01,1.36480944e+00,-9.93122082e-01, -// -5.72801650e-01,1.57306015e+00,6.43624768e-01,-1.84333229e+00,5.58127997e-01, -// -2.46238177e-01,1.65606267e+00,-1.83009428e+00,-1.78359195e+00,6.50885383e-01, -// -1.84839851e+00, -// }; -// k2c_tensor test7_input_1_input = {&test7_input_1_input_array[0],2,256,{ 8,32, 1, 1, 1}}; -// float keras_dense_3_test7_array[30] = { -// -8.55976641e-02,-8.65117386e-02,-8.91301185e-02,-9.32066739e-02,-9.88223925e-02, -// -1.05067573e-01,-1.11916363e-01,-1.17885001e-01,-1.22423649e-01,-1.21640220e-01, -// -1.19638994e-01,-1.18313290e-01,-1.17912076e-01,-1.15655318e-01,-1.00327596e-01, -// -2.25370210e-02,6.97263237e-03,4.33284305e-02,8.33650827e-02,1.18844397e-01, -// 1.36645764e-01,1.31355837e-01,1.12600945e-01,8.28189403e-02,4.27811630e-02, -// -3.67118418e-03,-5.38262837e-02,-1.03861660e-01,-1.51379764e-01,-1.93049610e-01, -// }; -// k2c_tensor keras_dense_3_test7 = {&keras_dense_3_test7_array[0],1,30,{30, 1, 1, 1, 1}}; -// float c_dense_3_test7_array[30] = {0}; -// k2c_tensor c_dense_3_test7 = {&c_dense_3_test7_array[0],1,30,{30, 1, 1, 1, 1}}; -// float test8_input_1_input_array[256] = { -// -1.92622192e+00,2.85414274e-01,-1.07321168e+00,5.92510322e-01,-1.54900327e+00, -// 7.77879152e-01,1.35939597e+00,-6.43227193e-01,-5.17805739e-01,-1.76707700e+00, -// 1.17562697e+00,-1.58273788e+00,-1.33911058e+00,-1.60655461e+00,1.32782663e+00, -// -1.58475300e+00,1.79156228e+00,-1.97329240e+00,6.99023014e-02,-2.50344016e-01, -// 3.36767025e-01,1.30687840e+00,2.57028191e-01,1.02665081e+00,-1.83625969e+00, -// 5.96870671e-01,1.39730386e+00,1.65750715e+00,2.25558920e-01,-1.09917526e+00, -// 7.82501594e-01,1.34832481e+00,1.59279991e+00,8.11461902e-01,-1.68268483e+00, -// 1.00092964e+00,9.25648422e-02,4.49842856e-01,2.78056831e-02,-1.76150514e+00, -// 3.02884690e-01,1.97372483e-01,3.75226460e-01,9.14185367e-01,1.00700127e+00, -// -1.17353858e+00,-1.29615273e+00,3.33243860e-01,1.43897967e+00,-1.67231143e+00, -// 8.14519562e-01,-1.79579846e+00,3.74931754e-01,1.76840560e+00,7.26742519e-01, -// -1.35173478e+00,1.17792744e+00,1.83528776e+00,8.10453971e-01,1.52204983e+00, -// -1.19158713e+00,7.45991057e-02,3.70471027e-01,-8.36285787e-01,1.43728059e+00, -// 1.02867699e-01,-1.10744039e+00,1.36935042e+00,-1.85285040e+00,5.28337825e-01, -// -7.28186967e-02,-1.22056253e+00,5.10256790e-01,-1.84576283e+00,1.32181012e+00, -// -1.91392517e+00,5.04778620e-01,1.57635345e+00,1.73454006e-01,8.08398547e-02, -// -1.19969281e+00,-1.67788479e-01,6.61152157e-01,9.27111726e-01,1.84938419e+00, -// 1.72188546e+00,-1.66915052e+00,-1.26728681e+00,-1.42687303e+00,-8.88006678e-01, -// -6.61563006e-01,-3.95864511e-03,1.44557773e-01,-7.20101848e-01,-3.94175771e-01, -// -1.47624230e-01,-1.38698801e-01,1.60943688e+00,1.56352173e+00,5.77136159e-01, -// 7.42038605e-01,3.39563510e-01,-1.39319999e+00,9.49178595e-01,4.28660696e-02, -// 1.31292228e-01,5.99876351e-02,6.58809953e-02,6.73997731e-01,-8.33106380e-01, -// -1.97271243e+00,2.78798370e-01,-5.49775014e-01,9.67667588e-01,6.51700302e-02, -// 1.82005444e+00,8.54925947e-01,1.65180211e+00,1.78543731e+00,-1.35918003e+00, -// 3.02966676e-01,-1.62883704e+00,1.31631424e+00,-1.44692870e+00,1.80908468e+00, -// -7.69531988e-01,5.77503258e-01,-1.46666677e+00,1.07288804e+00,8.03094606e-01, -// -8.42614893e-01,-2.84690614e-01,1.95926945e+00,-1.81248896e+00,1.61158171e+00, -// 1.27679887e+00,8.23157307e-01,-1.07494183e+00,7.73367244e-01,-1.57019168e+00, -// -6.98883319e-01,-1.70493690e+00,1.23829315e+00,-1.50921246e+00,2.88549631e-01, -// -1.41512199e+00,-2.53407356e-01,1.34184683e+00,-7.78690389e-01,7.67527096e-01, -// -1.49275435e+00,-8.57890849e-01,1.99065411e+00,4.24470452e-01,1.42866884e+00, -// -1.30543052e+00,1.72200153e+00,-1.21023550e+00,5.30088598e-02,-1.61943970e+00, -// -1.61108019e+00,-9.41505537e-01,-7.54241651e-02,3.87059745e-01,-1.65385092e+00, -// -4.52243580e-01,1.55467644e+00,1.82010988e+00,-1.90938170e+00,-1.47651208e+00, -// 1.05712391e+00,-1.11692354e+00,-6.40223996e-01,5.07043961e-02,-9.79388300e-01, -// -1.21132684e+00,-1.51217913e-01,1.52698740e+00,-1.12707667e+00,1.45517325e-01, -// -2.69871141e-01,-1.53881042e+00,1.13985338e+00,1.61471365e+00,-6.78228725e-01, -// -2.72823810e-01,-1.82669964e-01,-1.33928180e+00,-1.98090903e+00,2.91195624e-01, -// 4.45012844e-01,-1.69821517e+00,1.65844599e+00,3.02195699e-01,-4.29049815e-01, -// -1.72183295e+00,-6.97888696e-01,1.68133374e+00,1.41563235e+00,1.68694764e+00, -// 1.81853111e+00,-6.39444858e-01,-5.51033090e-01,-3.69620972e-01,-1.92459824e+00, -// -1.99527052e-01,1.69317827e+00,-9.85813597e-01,-1.36408438e+00,2.72572471e-01, -// -1.78043660e+00,-1.56594851e+00,-4.68790327e-01,4.95317394e-01,-1.71000271e+00, -// -1.48683234e+00,1.96894741e+00,1.57771192e+00,1.63700414e-01,-1.83647264e+00, -// 1.06935745e+00,1.34302831e+00,1.10654246e+00,-1.64710299e+00,-5.96678371e-01, -// -1.82644160e+00,8.87090420e-02,4.57409917e-01,1.75646177e+00,1.24660355e+00, -// -1.23847168e+00,1.99049520e-01,1.25829719e-02,-4.14147249e-01,7.80917932e-01, -// -7.25943149e-01,5.61712880e-01,2.77698900e-01,-1.05033860e+00,-1.84050132e+00, -// 1.95633754e+00,-1.02236804e+00,-1.46683974e+00,3.40032871e-01,3.17627497e-01, -// -1.27553462e+00,4.33758479e-01,1.54052464e-01,1.11808512e+00,-2.81199920e-01, -// -8.69641211e-01,9.51095565e-01,1.24585440e+00,-1.51160688e+00,1.56955837e+00, -// 1.61172238e+00, -// }; -// k2c_tensor test8_input_1_input = {&test8_input_1_input_array[0],2,256,{ 8,32, 1, 1, 1}}; -// float keras_dense_3_test8_array[30] = { -// -3.82929623e-01,-3.87524307e-01,-4.00286883e-01,-4.19873118e-01,-4.45181251e-01, -// -4.75017279e-01,-5.07107019e-01,-5.37313700e-01,-5.60845733e-01,-5.73705912e-01, -// -5.80371261e-01,-5.84050000e-01,-5.84306896e-01,-5.76383293e-01,-5.47291756e-01, -// -4.38328117e-01,-3.95588845e-01,-3.40285242e-01,-2.75021225e-01,-2.06755847e-01, -// -1.40810385e-01,-1.11639619e-01,-9.16689932e-02,-8.48298967e-02,-8.54375139e-02, -// -8.64963681e-02,-8.70952904e-02,-8.99286419e-02,-1.03499047e-01,-1.41163155e-01, -// }; -// k2c_tensor keras_dense_3_test8 = {&keras_dense_3_test8_array[0],1,30,{30, 1, 1, 1, 1}}; -// float c_dense_3_test8_array[30] = {0}; -// k2c_tensor c_dense_3_test8 = {&c_dense_3_test8_array[0],1,30,{30, 1, 1, 1, 1}}; -// float test9_input_1_input_array[256] = { -// -1.85835552e+00,-1.10839159e+00,2.43888672e-01,-7.67585611e-01,2.88883848e-01, -// 4.76870247e-01,-9.31719257e-01,1.95385245e+00,-6.08672081e-01,4.33890792e-01, -// 1.65198430e+00,-1.13887976e+00,-1.36861761e+00,1.18765224e+00,-8.60986408e-01, -// 2.52259257e-01,1.64995715e+00,1.37349697e+00,-1.09803385e+00,1.46971633e+00, -// 1.52874756e-01,1.47369957e+00,5.29604465e-02,-3.51575876e-01,-5.74283997e-01, -// -1.86593392e+00,-8.73164433e-01,1.07363962e+00,-7.81421996e-01,5.55808058e-01, -// -1.33709970e+00,9.12848241e-01,-1.39851442e+00,9.68320224e-01,1.90838016e+00, -// -7.01796463e-01,-2.51160937e-01,-6.98087985e-01,1.68977242e+00,2.60645656e-01, -// 7.21625989e-01,-1.17012273e+00,6.32715199e-02,-6.74043729e-02,-1.72552077e+00, -// 1.10187558e+00,1.69220410e+00,-1.31926319e+00,-8.10924506e-01,5.29318985e-01, -// -6.62563761e-01,-3.54202373e-01,-1.64574952e+00,-2.34093059e-01,1.69749189e+00, -// -1.99868162e-03,1.93503976e+00,1.47642011e+00,1.77364179e-01,3.99997904e-01, -// -1.51613830e+00,-9.15579395e-01,-1.07448740e+00,8.31695992e-01,-9.30308437e-01, -// -1.65040502e+00,-1.25110401e+00,-1.34161179e+00,2.72003550e-01,-9.87409312e-01, -// -1.78543017e+00,5.32659194e-01,-1.45091191e+00,-5.17470801e-02,-1.48181420e+00, -// 7.80126821e-04,1.49715110e-01,9.09844907e-02,1.53386695e+00,7.88754661e-01, -// 5.26422853e-01,1.30331010e+00,-1.15124620e-01,7.87754007e-01,6.29947523e-01, -// -1.13266262e+00,1.46258113e+00,-6.15817466e-01,4.77184018e-01,1.15707993e+00, -// 8.43333121e-01,1.56180338e+00,-6.53322896e-02,8.17126825e-02,1.85528918e+00, -// 1.59279678e+00,-5.79893163e-01,-1.04219784e+00,-3.91143012e-01,1.41472448e+00, -// 1.52088483e+00,1.02592341e+00,2.94024065e-01,-4.54911234e-01,-1.09179746e+00, -// -7.56416197e-01,-1.02344785e+00,1.81454311e+00,-1.93450531e+00,-1.92839104e+00, -// 1.59384803e-01,-1.59115269e+00,8.06247023e-01,5.09504364e-01,1.44931444e+00, -// 2.48160575e-01,-1.75801269e+00,-1.73305698e+00,-2.23321581e-01,-1.94584745e+00, -// -1.61647483e+00,-1.18106498e+00,-1.40379552e+00,-1.35878658e+00,-8.70920958e-02, -// -7.74511851e-01,-1.32682465e+00,1.84365343e+00,-1.51397234e+00,-1.82536247e+00, -// -1.81811106e+00,-1.77892243e+00,-7.23707748e-02,-9.92680753e-01,-7.58244693e-01, -// -8.29136290e-01,4.15874070e-01,1.00506881e+00,7.55061077e-01,-1.01512748e+00, -// -1.96309993e+00,1.54721753e-01,1.64788442e+00,2.40471049e-01,1.63223734e+00, -// -2.18702154e-01,-3.89706136e-01,-1.78945560e+00,5.01427220e-01,5.25878090e-02, -// 1.50381261e+00,1.12199375e-01,-1.59225326e+00,-9.83657534e-01,-1.34720267e+00, -// 1.35750498e+00,-1.39100176e+00,7.68601888e-01,9.19196735e-01,5.97348554e-01, -// -8.50331359e-01,1.64451704e+00,2.37564614e-01,1.12464696e+00,1.24073295e+00, -// -1.37601405e+00,-1.51379104e+00,-1.01820866e+00,9.15748156e-01,-8.58362079e-01, -// 7.04044104e-01,1.95944657e+00,-8.00483380e-01,-1.04617150e+00,-1.62341293e+00, -// -8.85478849e-01,-4.08830608e-01,-7.08172511e-01,1.66436692e+00,-1.04727042e+00, -// 1.74011391e+00,1.83142162e+00,1.21923263e+00,2.87303713e-01,1.63963920e+00, -// 1.75691402e+00,-4.65917666e-01,1.36694338e+00,8.45302531e-02,-1.86324819e+00, -// -7.73670830e-01,1.46044067e+00,-1.15668021e+00,-2.59768407e-01,-1.92274113e+00, -// -1.58906763e+00,1.75734312e+00,1.78015553e+00,-3.17221949e-01,-1.74774899e+00, -// 1.40257067e+00,3.29725412e-01,-2.72389754e-01,1.16588631e+00,-1.15224441e+00, -// 1.20923642e+00,-1.12998859e+00,1.78023208e-01,-1.95390414e+00,-1.21068489e+00, -// -1.12269168e+00,-3.34648788e-01,1.32708525e+00,5.92468257e-01,-5.41114365e-01, -// 7.87279406e-01,1.95139339e+00,6.66904664e-01,6.46404851e-01,1.55066107e+00, -// 8.07014252e-01,1.50253612e+00,-5.67494245e-01,-1.56949462e+00,-1.16281082e+00, -// 8.54867726e-01,-1.77582689e+00,1.50194721e+00,-1.64926332e+00,1.03374244e+00, -// -9.37022713e-01,1.65990666e+00,-1.85206946e+00,1.63637661e+00,1.02788567e+00, -// -1.63660736e+00,2.67761402e-02,-6.95558842e-01,1.55353504e+00,-1.91804090e+00, -// 1.07472910e+00,1.87757047e+00,1.82828651e-01,-6.44613944e-02,5.55827487e-01, -// 1.66808495e+00,-5.35270451e-01,-1.24055536e+00,-6.41002421e-01,9.08208839e-01, -// -1.19861710e+00,2.61123987e-01,2.68595698e-02,1.66443890e+00,2.27572665e-01, -// -9.68317753e-01, -// }; -// k2c_tensor test9_input_1_input = {&test9_input_1_input_array[0],2,256,{ 8,32, 1, 1, 1}}; -// float keras_dense_3_test9_array[30] = { -// -3.48752022e-01,-3.45180094e-01,-3.35804284e-01,-3.21533263e-01,-3.03947002e-01, -// -2.83879191e-01,-2.63354123e-01,-2.45156556e-01,-2.35456988e-01,-2.32268244e-01, -// -2.32620299e-01,-2.33338028e-01,-2.35277340e-01,-2.42577121e-01,-2.76523203e-01, -// -3.65429461e-01,-3.82709354e-01,-4.04872268e-01,-4.26784664e-01,-4.37480062e-01, -// -4.27401394e-01,-4.15125251e-01,-4.02646035e-01,-3.94071728e-01,-3.87437314e-01, -// -3.78919631e-01,-3.64845634e-01,-3.35072160e-01,-2.82954216e-01,-2.03323781e-01, -// }; -// k2c_tensor keras_dense_3_test9 = {&keras_dense_3_test9_array[0],1,30,{30, 1, 1, 1, 1}}; -// float c_dense_3_test9_array[30] = {0}; -// k2c_tensor c_dense_3_test9 = {&c_dense_3_test9_array[0],1,30,{30, 1, 1, 1, 1}}; -// float test10_input_1_input_array[256] = { -// -3.41671346e-01,-1.54325540e+00,6.86155716e-01,-6.30902095e-01,-5.36401940e-01, -// -1.73053088e+00,1.33608760e+00,1.68881671e+00,-3.92550750e-01,-5.67269669e-01, -// -4.32764266e-01,-1.23625597e+00,-7.88018967e-03,4.63877610e-01,1.91205616e-01, -// 9.18291142e-01,1.38906365e+00,1.26896705e+00,1.64496954e+00,-3.21575340e-03, -// 1.77147083e+00,-1.52576112e+00,1.48813206e+00,-3.96838699e-01,-1.17951113e+00, -// 1.27894472e+00,-9.41014811e-01,1.52834846e+00,3.50976157e-01,1.09478128e+00, -// 6.72126812e-01,-1.33992967e+00,-6.18535104e-01,1.83823477e+00,-5.30611487e-01, -// -1.96500384e+00,3.12799975e-01,1.33760102e+00,-1.74195149e+00,4.74864451e-01, -// -1.97769962e+00,1.41271327e+00,-1.44823029e+00,1.73361744e+00,-5.95195202e-01, -// 1.27334986e-01,-1.78670152e+00,-1.85961716e+00,-7.58877223e-01,1.43423522e+00, -// 4.17817332e-01,1.12784069e+00,1.61124166e+00,-1.52773196e-01,-3.82154207e-01, -// 4.72272003e-01,-1.22296865e+00,7.94491251e-01,6.47227121e-03,1.98018113e+00, -// 6.47795911e-01,-1.86897447e+00,5.31505639e-01,6.87685545e-01,-8.60439906e-01, -// 9.06581641e-01,3.98230063e-01,2.82226102e-01,-1.71208182e+00,1.84294061e+00, -// -5.26661930e-01,-4.01337722e-01,-5.20333099e-01,8.40129099e-01,1.35573908e+00, -// 1.35362964e+00,-1.07820349e+00,-6.74820394e-01,6.62187461e-01,1.66973525e+00, -// -5.70959379e-01,1.09797592e+00,2.34665845e-01,-1.81591508e+00,-1.22935991e+00, -// -1.98215985e+00,-1.37085822e+00,2.09453007e-01,1.51753555e+00,2.46945831e-01, -// 1.18148733e+00,1.95672593e+00,-7.49696779e-01,6.57288178e-01,1.91507961e+00, -// 1.70444096e-01,-1.02673618e+00,1.06170418e+00,2.41188194e-01,3.40505686e-01, -// -8.77807556e-01,-1.84593007e+00,-1.40814284e+00,-1.90169466e+00,1.92661515e-01, -// -1.03059032e+00,-9.89329239e-01,-1.57107677e+00,2.07395515e-01,6.44777801e-02, -// -3.45364908e-01,1.71776421e+00,-1.35679015e+00,9.61851459e-01,-1.93527754e+00, -// -1.83405015e+00,-7.19088422e-01,1.64235728e+00,-5.57112237e-01,7.56778128e-03, -// 1.44769360e+00,1.16074998e+00,4.72000236e-01,1.91814857e+00,-1.08294286e+00, -// -1.49500018e+00,-7.68220447e-01,-9.17713341e-01,-8.43071474e-01,-1.04282617e-01, -// -1.24201412e+00,-7.12124545e-01,1.02608580e+00,9.25201894e-01,6.25752254e-01, -// 6.41376660e-01,-5.81685321e-01,-1.32234103e+00,1.20126053e+00,-1.60017084e-01, -// -4.74928992e-01,-5.49356571e-01,-1.70717894e+00,2.74295366e-01,6.97026430e-01, -// 1.73631490e+00,1.39272892e+00,-1.81032980e+00,-1.02434561e+00,1.71578193e+00, -// 1.69092588e+00,-1.72794307e+00,1.38487153e+00,-4.32043538e-01,-1.73729775e+00, -// 6.25899602e-01,9.19933219e-02,6.08928591e-01,-5.38299142e-02,1.57621463e+00, -// 6.09105143e-01,-8.30732350e-02,1.20276847e+00,-1.57790873e+00,-1.27502189e+00, -// -1.94255828e+00,-1.27045170e+00,1.51946128e+00,-1.08746447e+00,7.43077127e-01, -// -8.79456262e-01,-9.93238771e-01,1.44814215e-01,-6.73317568e-01,3.20384211e-01, -// 6.67772808e-01,1.46569145e+00,-3.23761641e-01,-1.74459659e+00,6.10771844e-01, -// 8.35403622e-01,1.15995873e+00,-3.75055828e-01,1.29641437e+00,1.40810935e+00, -// -7.41698957e-01,1.75030525e+00,-1.76633799e+00,-1.70083084e+00,5.59418305e-01, -// -1.48094604e+00,-1.34843908e-01,-8.39840946e-01,-1.55522628e+00,-1.61800946e+00, -// -8.32360671e-01,-9.62365881e-01,-5.68685570e-01,-1.53764955e+00,-7.87939200e-01, -// 5.19723502e-01,-1.04533768e+00,-9.20617754e-01,-1.79773399e+00,-1.84599735e+00, -// 5.17475555e-01,-1.30445237e+00,1.05137764e+00,-1.74131852e+00,-3.62654444e-01, -// 1.21991315e+00,1.39095570e+00,-1.30960353e+00,-6.87536694e-01,1.74286756e+00, -// 8.62760924e-01,9.63646899e-01,1.52776503e+00,1.26549420e+00,-1.66126214e+00, -// 6.21972125e-02,-1.43309943e+00,3.29493319e-01,1.61306882e+00,2.02419842e-01, -// 6.02165945e-01,-6.35108415e-01,9.63552859e-02,8.25591016e-01,1.68121928e+00, -// 6.86903034e-02,-3.74259267e-01,-1.27058770e+00,-1.68856313e+00,1.93260088e+00, -// -1.59323267e+00,-5.04090623e-01,-1.20993657e+00,1.84498621e+00,6.09392432e-01, -// 6.87551324e-01,-7.10376993e-01,7.12227696e-01,1.36447033e-01,4.65503348e-01, -// 1.33219289e+00,1.67597434e+00,-3.12798652e-01,1.67263889e+00,1.40096529e+00, -// -1.06588389e+00,1.35423779e+00,-1.92860404e+00,-5.41325371e-01,-1.79852194e+00, -// 1.35486365e+00, -// }; -// k2c_tensor test10_input_1_input = {&test10_input_1_input_array[0],2,256,{ 8,32, 1, 1, 1}}; -// float keras_dense_3_test10_array[30] = { -// -5.11613011e-01,-5.06632924e-01,-4.94407684e-01,-4.75816339e-01,-4.53840941e-01, -// -4.30415362e-01,-4.07390565e-01,-3.88879508e-01,-3.83333385e-01,-3.87589484e-01, -// -3.95265847e-01,-4.00307268e-01,-4.02860999e-01,-4.10110682e-01,-4.59861219e-01, -// -5.87389946e-01,-6.05038047e-01,-6.28401041e-01,-6.52574718e-01,-6.64265096e-01, -// -6.57461464e-01,-6.52071297e-01,-6.53667808e-01,-6.70469642e-01,-6.99257076e-01, -// -7.33901501e-01,-7.66791165e-01,-7.63884842e-01,-7.05482125e-01,-5.60091972e-01, -// }; -// k2c_tensor keras_dense_3_test10 = {&keras_dense_3_test10_array[0],1,30,{30, 1, 1, 1, 1}}; -// float c_dense_3_test10_array[30] = {0}; -// k2c_tensor c_dense_3_test10 = {&c_dense_3_test10_array[0],1,30,{30, 1, 1, 1, 1}}; -// float errors[10]; -// size_t num_tests = 10; -// size_t num_outputs = 1; -// example_initialize(); -// clock_t t0 = clock(); -// example(&test1_input_1_input,&c_dense_3_test1); -// example(&test2_input_1_input,&c_dense_3_test2); -// example(&test3_input_1_input,&c_dense_3_test3); -// example(&test4_input_1_input,&c_dense_3_test4); -// example(&test5_input_1_input,&c_dense_3_test5); -// example(&test6_input_1_input,&c_dense_3_test6); -// example(&test7_input_1_input,&c_dense_3_test7); -// example(&test8_input_1_input,&c_dense_3_test8); -// example(&test9_input_1_input,&c_dense_3_test9); -// example(&test10_input_1_input,&c_dense_3_test10); -// clock_t t1 = clock(); -// // printf("Average time over 10 tests: %e s \n",(double)(t1-t0)/(double)CLOCKS_PER_SEC/(double)10); -// errors[0] = maxabs(&keras_dense_3_test1,&c_dense_3_test1); -// errors[1] = maxabs(&keras_dense_3_test2,&c_dense_3_test2); -// errors[2] = maxabs(&keras_dense_3_test3,&c_dense_3_test3); -// errors[3] = maxabs(&keras_dense_3_test4,&c_dense_3_test4); -// errors[4] = maxabs(&keras_dense_3_test5,&c_dense_3_test5); -// errors[5] = maxabs(&keras_dense_3_test6,&c_dense_3_test6); -// errors[6] = maxabs(&keras_dense_3_test7,&c_dense_3_test7); -// errors[7] = maxabs(&keras_dense_3_test8,&c_dense_3_test8); -// errors[8] = maxabs(&keras_dense_3_test9,&c_dense_3_test9); -// errors[9] = maxabs(&keras_dense_3_test10,&c_dense_3_test10); -// float maxerror = errors[0]; -// for(size_t i=1; i< num_tests*num_outputs; i++) { -// if (errors[i] > maxerror) { -// maxerror = errors[i]; -// } -// } -// // printf("Max absolute error for 10 tests: %e \n", maxerror); -// example_terminate(); -// if (maxerror > 1e-05) { -// return 1; -// } -// return 0; -// } -// float maxabs(k2c_tensor *tensor1, k2c_tensor *tensor2) { -// float x = 0; + // PWM variables + uint32_t counter = UINT8_MAX; + uint32_t brightness = 0; + bool ascending = true; + // The three least significant bits correspond to RGB, where B is the leas significant. + uint8_t color = 7; -// float y = 0; + while (1) { + uint64_t cur_time = get_elapsed_time(); -// for (size_t i = 0; i < tensor1->numel; i++) { -// y = fabs(tensor1->array[i] - tensor2->array[i]); -// if (y > x) { -// x = y; -// } -// } -// return x; -// } + if (cur_time != last_elapsed_time) { + last_elapsed_time = cur_time; -// void test_and2_irq(void) __attribute__((interrupt)); + // Disable interrupts whilst outputting to prevent output for RX IRQ + // happening in the middle + set_global_interrupt_enable(0); -// volatile uint32_t result; + // Print this to UART (use the screen command to see it). + puts("Hello World! "); + puthex(last_elapsed_time); + puts(" Input Value: "); + uint32_t in_val = read_gpio(GPIO_IN_DBNC); + puthex(in_val); + putchar('\n'); -// void test_and2_irq(void) { -// uint32_t a = 9561753; -// write_input(a); -// asm volatile("wfi"); -// } + // Re-enable interrupts with output complete + set_global_interrupt_enable(1); -// int main() { -// install_exception_handler(AND_IRQ_NUM, &test_and2_irq); + // Cycling through green LEDs + if (USE_GPIO_SHIFT_REG) { + // Feed value of BTN0 into the shift register + set_outputs(GPIO_OUT_SHIFT, in_val); + } else { + // Cycle through LEDs unless BTN0 is pressed + uint32_t out_val = read_gpio(GPIO_OUT); + out_val = (out_val << 1) & GPIO_LED_MASK; + if ((in_val & 0x1) || (out_val == 0)) { + out_val = 0x10; + } + set_outputs(GPIO_OUT, out_val); + } -// result = get_result(); -// puthex(result); -// return 0; -// } + // Going from bright to dim on PWM + for (int i = 0; i < NUM_PWM_MODULES; i++) { + set_pwm(PWM_FROM_ADDR_AND_INDEX(PWM_BASE, i), ((1 << (i % 3)) & color) ? counter : 0, + brightness ? 1 << (brightness - 1) : 0); + } + if (ascending) { + brightness++; + if (brightness >= 5) { + ascending = false; + } + } else { + brightness--; + // When LEDs are off cycle through the colors + if (brightness == 0) { + ascending = true; + color++; + if (color >= 8) { + color = 1; + } + } + } + } -int main() { - uint16_t a = 1753, b = 956; - puthex(a & b); - putchar('__'); - return 0; + asm volatile("wfi"); + } } \ No newline at end of file diff --git a/sw/c/demo/simpleserial-aes/CMakeLists.txt b/sw/c/demo/simpleserial-aes/CMakeLists.txt deleted file mode 100644 index bb9312ef..00000000 --- a/sw/c/demo/simpleserial-aes/CMakeLists.txt +++ /dev/null @@ -1,22 +0,0 @@ -add_definitions(-DTINYAES128C -DSS_VER=1 -DHAL_TYPE=HAL_ibex) - -include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../../vendor/newae/crypto) -include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../../vendor/newae/hal) -include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../../vendor/newae/simpleserial) -include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../../vendor/newae/crypto/tiny-AES128-C) -include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../common) - -add_library(simpleserial -${CMAKE_CURRENT_SOURCE_DIR}/../../../../vendor/newae/simpleserial/simpleserial.c -${CMAKE_CURRENT_SOURCE_DIR}/../../../../vendor/newae/hal/ibex/ibex_hal.c -) - -add_library(tiny-AES128 -${CMAKE_CURRENT_SOURCE_DIR}/../../../../vendor/newae/crypto/aes-independant.c -${CMAKE_CURRENT_SOURCE_DIR}/../../../../vendor/newae/crypto/tiny-AES128-C/aes.c -) - -add_executable(simpleserial-aes ${CMAKE_CURRENT_SOURCE_DIR}/../../../../vendor/newae/simpleserial-aes/simpleserial-aes.c) - -target_link_libraries(simpleserial-aes common simpleserial tiny-AES128) - diff --git a/sw/c/demo/simpleserial-aes/README b/sw/c/demo/simpleserial-aes/README deleted file mode 100644 index 8a5cb84d..00000000 --- a/sw/c/demo/simpleserial-aes/README +++ /dev/null @@ -1,18 +0,0 @@ -ChipWhisperer simpleserial-aes application, intended to be run on a -ChipWhisperer FPGA target (synth_cw305 or synth_cw312a35 targets). - -This can then be used with any of the NewAE Jupyter-based courses -(https://github.com/newaetech/chipwhisperer-jupyter/tree/master/courses) -which use simpleserial-aes, with modifications to the target clock and baud -rate: - scope.clock.adc_mul = 1 # if using CW-Husky - scope.clock.adc_src = 'clkgen_x1' # if using CW-lite/pro - scope.clock.clkgen_freq = 100e6 - target.baud = 115200 - -Note that this application (and many others!) can also be built in the -ChipWhisperer repository: - https://github.com/newaetech/chipwhisperer/tree/develop/hardware/victims/firmware/simpleserial-aes -using: - make PLATFORM=CW305_IBEX CRYPTO_TARGET=TINYAES128C - diff --git a/sw/c/demo/test_accel/CMakeLists.txt b/sw/c/demo/test_accel/CMakeLists.txt new file mode 100644 index 00000000..88e4c558 --- /dev/null +++ b/sw/c/demo/test_accel/CMakeLists.txt @@ -0,0 +1,2 @@ +add_executable(test_accel main.c) +target_link_libraries(test_accel common m) \ No newline at end of file diff --git a/sw/c/demo/test_accel/main.c b/sw/c/demo/test_accel/main.c new file mode 100644 index 00000000..c3434189 --- /dev/null +++ b/sw/c/demo/test_accel/main.c @@ -0,0 +1,35 @@ +#include +#include +#include +#include +#include "and2.h" +#include "demo_system.h" +#include "example.h" +#include "stdint.h" +#include "stdbool.h" + +void test_and2_irq(void) __attribute__((interrupt)); + +volatile uint32_t result; + +void test_and2_irq(void) { + uint32_t a = 9561753; + write_input(a); + asm volatile("wfi"); +} + +int main() { + install_exception_handler(AND_IRQ_NUM, &test_and2_irq); + + result = get_result(); + while(true) + puthex(result); + return 0; +} + +// int main() { +// uint16_t a = 1753, b = 956; +// puthex(a & b); +// putchar('__'); +// return 0; +// } \ No newline at end of file diff --git a/sw/c/demo/test_ip/CMakeLists.txt b/sw/c/demo/test_ip/CMakeLists.txt new file mode 100644 index 00000000..8bd8a7e3 --- /dev/null +++ b/sw/c/demo/test_ip/CMakeLists.txt @@ -0,0 +1,2 @@ +add_executable(test_ip main.c) +target_link_libraries(test_ip common m) diff --git a/sw/c/demo/test_ip/main.c b/sw/c/demo/test_ip/main.c new file mode 100644 index 00000000..1f52fa66 --- /dev/null +++ b/sw/c/demo/test_ip/main.c @@ -0,0 +1,32 @@ +#include +#include +#include +#include +#include "and2.h" +#include "demo_system.h" +#include "example.h" +#include "stdint.h" +#include "stdbool.h" + +void test_and2_irq(void) __attribute__((interrupt)); + +volatile uint32_t result; + +void test_and2_irq(void) { + uint32_t a = 9561753; + write_input(a); + asm volatile("wfi"); +} + +int main() { + install_exception_handler(AND_IRQ_NUM, &test_and2_irq); + result = get_result(); + uint16_t a = 956, b = 1753; + // uint32_t c = a & b; + puthex(a & b); + puts("_____"); + puthex(result); + puts("\n"); + return 0; +} +