virtual interfaces in xsim?
-
- Active Member
- Posts: 50
- Joined: Wed Dec 16, 2009 6:04 pm
- Location: London
virtual interfaces in xsim?
are there any ways of simulating ethernet virtual network interface or socket using xsim simulator?
Last edited by errordeveloper on Thu Oct 20, 2011 11:14 am, edited 1 time in total.
-
- Respected Member
- Posts: 363
- Joined: Thu Dec 10, 2009 10:17 pm
Dream on. The only hardware emulation you have is connecting pins together.
-
- Experienced Member
- Posts: 84
- Joined: Mon Jan 18, 2010 2:52 pm
xsim does support user created plugins and testbenches, which can be used to model any external interface/peripherial/system. These are created in c/c++, and can act as an alternative to using the pin loopbacks for verification. There are basically 2 ways in which these can be used:
1) Plugin: Users can create plugins (dlls), which get called from xsim each cycle and have access to the pins, switch, memory, etc.
2) Testbench: In this mode xsim is the slave, and the user would need to write the system (i.e. main), and again has access to the xcores pins, memory etc.
This feature is avaliable in the 10.4 tools, although is not extensivley used at present and is not fully documented. However, the best place to get started with this is to look at the examples that come with the tools. The plugin/testbench code can be found in src/, and the target (xc) code is in examples/. Not sure if this is what you need in this case, but let me know if you have any questions about it.
Cheers,
Kris.
1) Plugin: Users can create plugins (dlls), which get called from xsim each cycle and have access to the pins, switch, memory, etc.
2) Testbench: In this mode xsim is the slave, and the user would need to write the system (i.e. main), and again has access to the xcores pins, memory etc.
This feature is avaliable in the 10.4 tools, although is not extensivley used at present and is not fully documented. However, the best place to get started with this is to look at the examples that come with the tools. The plugin/testbench code can be found in src/, and the target (xc) code is in examples/. Not sure if this is what you need in this case, but let me know if you have any questions about it.
Cheers,
Kris.
-
- Experienced Member
- Posts: 84
- Joined: Mon Jan 18, 2010 2:52 pm
Just incase you are interested, attached is an example simulator plugin that reads the pwm output on given pin, and displays the % duty cycle on each pwm cycle. This also shows how the target code can communicate with the plugin using the custom syscall mechanism and how the plugin can communicate with the target code via target memory reads/writes.
You do not have the required permissions to view the files attached to this post.
-
- Member
- Posts: 13
- Joined: Fri Dec 11, 2009 10:51 am
I have written an Ethernet MII receive and transmit plugins in the past. They've gone out of date since - source attached for your reference. It can be used for basic dumb communication like send/receive a UDP packet. It has no intelligence, just an XML file that describes the order and timing of received and sent packets.
A network emulating plugin could be a bit too heavyweight for the simulator. Also, the simulator loopback connection gives you very much the same functionality (with two nodes, each running its own copy of the network stack and own IP address) without having to write/port an entire stack.
A network emulating plugin could be a bit too heavyweight for the simulator. Also, the simulator loopback connection gives you very much the same functionality (with two nodes, each running its own copy of the network stack and own IP address) without having to write/port an entire stack.
You do not have the required permissions to view the files attached to this post.
-
- Active Member
- Posts: 50
- Joined: Wed Dec 16, 2009 6:04 pm
- Location: London
That's exactly what i need! Thanx very much, snowman!snowman wrote: A network emulating plugin could be a bit too heavyweight for the simulator. Also, the simulator loopback connection gives you very much the same functionality (with two nodes, each running its own copy of the network stack and own IP address) without having to write/port an entire stack.
I didn't mean 'network' as in a bunch of nodes, loopback is what actually meant ;))
-
- Active Member
- Posts: 50
- Joined: Wed Dec 16, 2009 6:04 pm
- Location: London
That would very useful for my project too!kris wrote:Just incase you are interested, attached is an example simulator plugin that reads the pwm output on given pin, and displays the % duty cycle on each pwm cycle. This also shows how the target code can communicate with the plugin using the custom syscall mechanism and how the plugin can communicate with the target code via target memory reads/writes.
Appreciated, that's great :)