diff --git a/architecture/RISC_V_RV32IMFD.json b/architecture/RISC_V_RV32IMFD.json index ada9286bd..8805f74e4 100644 --- a/architecture/RISC_V_RV32IMFD.json +++ b/architecture/RISC_V_RV32IMFD.json @@ -1868,7 +1868,7 @@ "stopbit": 7 } ], - "definition": "let a = capi_float2bin(rs1);\nrd=capi_check_ieee(parseInt(a[0]), parseInt(a.slice(1,12), 2), parseInt(a.slice(13), 2));", + "definition": "let a = capi_double2bin(rs1);\nrd=capi_check_ieee(a[0], a.slice(1,12), a.slice(13));", "separated": [ false, false, @@ -1930,7 +1930,7 @@ "valueField": "001" } ], - "definition": "let a = capi_float2bin(rs1);\nrd=capi_check_ieee(parseInt(a[0]), parseInt(a.slice(1,9), 2), parseInt(a.slice(10), 2));", + "definition": "let a = capi_float2bin(rs1);\nrd=capi_check_ieee(a[0], a.slice(1,9), a.slice(10));", "separated": [ false, false, diff --git a/gateway/esp32-rv/gateway.py b/gateway/esp32-rv/gateway.py index 1984e3ed6..8b6e5c29c 100755 --- a/gateway/esp32-rv/gateway.py +++ b/gateway/esp32-rv/gateway.py @@ -196,12 +196,12 @@ def do_flash_request(request): req_data['status'] += 'Error adapting assembly file...\n' # flashing steps... - if error == 0 : - error = check_uart_connection(target_device) - if error != 0: - req_data['status'] += 'No UART port found.\n' - logging.error("No UART port found.") - raise Exception("No UART port found") + # if error == 0 : + # error = check_uart_connection(target_device) + # if error != 0: + # req_data['status'] += 'No UART port found.\n' + # logging.error("No UART port found.") + # raise Exception("No UART port found") if error == 0: error = do_cmd(req_data, ['idf.py', 'fullclean']) # Disable memory protection @@ -216,7 +216,7 @@ def do_flash_request(request): "# CONFIG_ESP_SYSTEM_MEMPROT_FEATURE_LOCK is not set\n" ) #TODO: Add other boards here... - elif target_board == 'esp32c6': + elif target_board == 'esp32c6' or target_board == 'esp32h2': with open(defaults_path, "w") as f: f.write( "CONFIG_FREERTOS_HZ=1000\n" @@ -238,7 +238,7 @@ def do_flash_request(request): r'/^CONFIG_ESP_SYSTEM_MEMPROT_FEATURE_LOCK=/c\# CONFIG_ESP_SYSTEM_MEMPROT_FEATURE_LOCK is not set', sdkconfig_path ]) - elif target_board == 'esp32c6': + elif target_board == 'esp32c6' or target_board == 'esp32h2': #CONFIG_FREERTOS_HZ=1000 do_cmd(req_data, [ 'sed', '-i', @@ -286,7 +286,7 @@ def do_monitor_request(request): build_root = BUILD_PATH +'/build' error = 0 - error = check_uart_connection(target_device) + # error = check_uart_connection(target_device) if error != 0: logging.info("No UART found") req_data['status'] += "No UART port found\n" @@ -474,9 +474,9 @@ def start_gdbgui(req_data): req_data['status'] += f"GDB route: {route} does not exist.\n" return jsonify(req_data) req_data['status'] = '' - if check_uart_connection(target_device) != 0: - req_data['status'] += f"No UART found\n" - return jsonify(req_data) + # if check_uart_connection(target_device) != 0: + # req_data['status'] += f"No UART found\n" + # return jsonify(req_data) logging.info("Starting GDBGUI...") gdbgui_cmd = ['idf.py', '-C', BUILD_PATH, 'gdbgui', '--gdbinit', route, 'monitor'] @@ -527,13 +527,13 @@ def do_debug_request(request): kill_all_processes("openocd") process_holder.pop('openocd', None) # Check UART - if check_uart_connection(target_device) != 0: - req_data['status'] += f"No UART found\n" - return jsonify(req_data) + # if check_uart_connection(target_device) != 0: + # req_data['status'] += f"No UART found\n" + # return jsonify(req_data) # Check if JTAG is connected - if not check_jtag_connection(): - req_data['status'] += "No JTAG found\n" - return jsonify(req_data) + # if not check_jtag_connection(): + # req_data['status'] += "No JTAG found\n" + # return jsonify(req_data) # Start OpenOCD logging.info("Starting OpenOCD...") diff --git a/gateway/esp32c2.zip b/gateway/esp32c2.zip index 81665255b..f26e8c396 100644 Binary files a/gateway/esp32c2.zip and b/gateway/esp32c2.zip differ diff --git a/gateway/esp32c3.zip b/gateway/esp32c3.zip index ff7e00321..72b7d11c7 100644 Binary files a/gateway/esp32c3.zip and b/gateway/esp32c3.zip differ diff --git a/gateway/esp32c6.zip b/gateway/esp32c6.zip index 5c71d0252..503ad0606 100644 Binary files a/gateway/esp32c6.zip and b/gateway/esp32c6.zip differ diff --git a/gateway/esp32h2.zip b/gateway/esp32h2.zip index 97c75a16f..a831c80f6 100644 Binary files a/gateway/esp32h2.zip and b/gateway/esp32h2.zip differ diff --git a/gateway/esp32s2.zip b/gateway/esp32s2.zip index 3086a75c5..c2923f93f 100644 Binary files a/gateway/esp32s2.zip and b/gateway/esp32s2.zip differ diff --git a/gateway/esp32s3.zip b/gateway/esp32s3.zip index 5efb84fea..1c14cca60 100644 Binary files a/gateway/esp32s3.zip and b/gateway/esp32s3.zip differ diff --git a/js/creator_util.js b/js/creator_util.js index c1ed65844..67ed1493b 100644 --- a/js/creator_util.js +++ b/js/creator_util.js @@ -25,38 +25,41 @@ */ /** - * method in chage of map a float number separated in parts and determinte what it. - * @param s {Number} the sign of the number - * @param e {Number} the exponent of the number. - * @param m {Number} the mantinsa of the number + * method in charge of map a float number separated in parts and determine what it. + * @param s {string} the sign of the number + * @param e {string} the exponent of the number. + * @param m {string} the mantinsa of the number * @return {number} 2^n with n as - * 0 -> -infinite + * 0 -> -inf * 1 -> -normalized number * 2 -> -non-normalized number * 3 -> -0 * 4 -> +0 - * 5 -> +normalized number - * 6 -> +non-normalized number + * 5 -> +non-normalized number + * 6 -> +normalized number * 7 -> +inf - * 8 -> -NaN - * 9 -> +NaN + * 8 -> signaling NaN + * 9 -> quiet NaN */ function checkTypeIEEE(s, e, m) { let rd = 0; - - if (!m && !e) - rd = s ? 1<<3 : 1<<4; - else if (!e) - rd = s ? 1<<2 : 1<<5; - else if (!(e ^ 255)) - if (m) - rd = s ? 1<<8 : 1<<9; - else - rd = s ? 1<<0 : 1<<7; + const s_int = parseInt(s, 2) + const e_int = parseInt(e, 2) + const m_int = parseInt(m, 2) + + if (!m_int && !e_int) // mantisa and exponent are 0 => ±0 + rd = s_int ? 3 : 4; + else if (!e_int) // exponent is 0 but mantisa isn't => ±non-normalized number + rd = s_int ? 2 : 5; + else if (!(e.includes("0"))) // exponent is all 1s + if (m_int) // mantisa isn't 0 => NaN. It's signaling if the MSB of the mantisa is 0 + rd = m[0] === "0" ? 8 : 9 + else // mantisa is 0 => ±inf + rd = s_int ? 0 : 7 else - rd = s ? 1<<1 : 1<<6; - return rd; + rd = s_int ? 1 : 6; + return 1 << rd; } /* @@ -312,4 +315,4 @@ if(creator_debug){ console.log(m); } - } \ No newline at end of file + }