I have a problem tracing signals when simulating my application which uses an external plugin to handle the pins my application is looking at.
What I get from xtimecomposer after pressing run is:
I am sure I am not setting things up properly and is therefore in need of someone pointing in the right direction. The plugin needs three argument which are given as space separated strings after the specified plugin file on the External tab under Simulator when opening the Run Configurations window. The arguments must be "0 X0D23 X0D13" (without the two ")XScopePlugin: Error: Unable to find __sodFlag symbol on tile: tile[0]
My target code is this:
Code: Select all
#include <i2c.h>
#include <xs1.h>
#include <platform.h>
#include <syscall.h>
port p_scl = XS1_PORT_1F; // XOD13
port p_sda = XS1_PORT_1H; // XOD23
//[[distributable]]
void i2c_slave_register_file(server i2c_slave_callback_if i2c)
{
while (1) {
select {
case i2c.start_read_request(void):
break;
case i2c.ack_read_request(void) -> i2c_slave_ack_t response:
response = I2C_SLAVE_ACK;
break;
case i2c.start_write_request(void):
break;
case i2c.ack_write_request(void) -> i2c_slave_ack_t response:
response = I2C_SLAVE_ACK;
break;
case i2c.start_master_write(void):
break;
case i2c.master_sent_data(uint8_t data) -> i2c_slave_ack_t response:
response = I2C_SLAVE_ACK;
break;
case i2c.start_master_read(void):
break;
case i2c.master_requires_data() -> uint8_t data:
data = 1;
break;
case i2c.stop_bit():
break;
}
}
}
int main() {
i2c_slave_callback_if i_i2c;
par {
i2c_slave_register_file(i_i2c);
i2c_slave(i_i2c, p_scl, p_sda, 0x21);
}
return 0;
}
I have attached my plugin as plugintest.tar.gz (both source code folder and the resulting .so file built for x86_64) if somebody wants to test, md5sum should be: 9f915a8018daf8c53badb38d4145fa40. Note, the library makefile is made with paths for placing the library in the lib folder such that its location should be inside the plugin folder (Community_14.0.3/src/plugins/I2CTestPlugin)
Make the library by:
make -f MakefileUnixGPP.mak
g++ -g -fPIC -O3 -Wall -Wsign-compare -Wpointer-arith -c I2CTestPlugin.cpp -o I2CTestPlugin.o -I../../../include
g++ I2CTestPlugin.o -shared -o ../../../lib/I2CTestPlugin.so -lc -ldl -lstdc++