Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions architecture/RISC_V_RV32IMFD.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
36 changes: 18 additions & 18 deletions gateway/esp32-rv/gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Expand All @@ -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',
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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']
Expand Down Expand Up @@ -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...")
Expand Down
Binary file modified gateway/esp32c2.zip
Binary file not shown.
Binary file modified gateway/esp32c3.zip
Binary file not shown.
Binary file modified gateway/esp32c6.zip
Binary file not shown.
Binary file modified gateway/esp32h2.zip
Binary file not shown.
Binary file modified gateway/esp32s2.zip
Binary file not shown.
Binary file modified gateway/esp32s3.zip
Binary file not shown.
47 changes: 25 additions & 22 deletions js/creator_util.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/*
Expand Down Expand Up @@ -312,4 +315,4 @@
if(creator_debug){
console.log(m);
}
}
}