Telnet proxy
Requirements
None
Description
This example shows how to run GVSOC with a telnet proxy opened, and how to connect a python script to it to control its behavior dynamically.
Code
#!/usr/bin/env python3
import argparse
import gv.gvsoc_control as gvsoc
parser = argparse.ArgumentParser(description='Control GVSOC')
parser.add_argument("--host", dest="host", default="localhost", help="Specify host name")
parser.add_argument("--port", dest="port", default=42951, type=int, help="Specify host port")
args = parser.parse_args()
gv = gvsoc.Proxy(args.host, args.port)
# Run for 10 ms
gv.run(100000000)
# Activate FC instructions and dump to file log
gv.trace_add('fc/insn:log')
# Run for 10 ms with traces enabled
gv.run(100000000)
# Deactivate FC instructions
gv.trace_remove('fc/insn:log')
# Run until the end without traces
gv.run()
# Close proxy connection
gv.close()
/*
* Copyright (C) 2021 GreenWaves Technologies
* All rights reserved.
*
* This software may be modified and distributed under the terms
* of the BSD license. See the LICENSE file for details.
*
*/
#include "pmsis.h"
#include "stdio.h"
int main(void)
{
printf("(%ld, %ld) Entering main controller\n", pi_cluster_id(), pi_core_id());
return 0;
}