Coder Social home page Coder Social logo

openvsm's Introduction

Pugnator's GitHub stats

openvsm's People

Contributors

nm156 avatar pugnator avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

openvsm's Issues

MSVC build is broken

At least at VS2015Pro
A lot of files were refactored and moved, so it needs to be fixed. Also Lua integration is broken in MSVC or never worked at all

It is impossible to use inverted pins

Inverted pins must be surrounded with $ sign in order to be drawn correctly. It is impossible in Lua to create such a variable, so it should be transformed to something else.
I think the better is to use underscore, for example CS instead of $CS$
It should be transformed to $CS$ on C side

Add ability to set callback to any pin/bus

It should be possible to create callback for pins, buses and in future to any virtual objects.
It is not a good idea to check some pins every time simulate function is called, better to set callback [if pin is high]. The same is for buses

Problem with compiling functioning DLL

Can you tell me what platform and gcc version were used to build the files in the example directory?
All 3 are different sizes even after stripping, indicating some source code change,

Files in github
-rwxr-xr-x 1 nm156 Administ 235549 Dec 2 13:44 addr.dll
-rwxr-xr-x 1 nm156 Administ 2301614 Dec 2 13:44 dbg.dll
-rwxr-xr-x 1 nm156 Administ 2300892 Dec 2 13:44 k573.dll

After debug strip
-rwxr-xr-x 1 nm156 Administ 235549 Feb 11 18:59 addr.dll
-rwxr-xr-x 1 nm156 Administ 237070 Feb 11 18:59 dbg.dll
-rwxr-xr-x 1 nm156 Administ 236558 Feb 11 18:59 k573.dll

I tried to compile the github sources on two platforms, both compile
cleanly but neither work properly. (No outputs from dbg or k573)

I used:
Linux: gcc-mingw32-4.4.2
-rwxr-xr-x 1 nm156 nm156 237597 2015-02-11 18:17 openvsm.dll

Windows (mingw) : gcc-4.8.1
-rwxr-xr-x 1 nm156 Administrators 251406 Feb 11 18:38 openvsm.dll

Each of the versions I built seem to ignore get_pin_bool()

I used my DLL for dbg.dll only and if I change the dbg.dll.lua to this:

function device_simulate()
for i = 0, 7 do
if 15 == get_pin_state(_G["D"..i]) then
-- if 1 == get_pin_bool(_G["D"..i]) then
DATA_BUS = set_bit(DATA_BUS, i)
else
DATA_BUS = clear_bit(DATA_BUS, i)
end
end

text = string.format("[%d] Fetched opcode %.2X\r\n", systime(), DATA_BUS)
out_log(text)
uart_send(text)

end

I can see the fetched opcode correctly, otherwise DATA_BUS is always 0

With the provided DLLs everything works fine.

MIPS/ARM support

It will be fine to support x86 emulation through QEMU, it will be possible to emulate x86 hardware/videoboards etc with nice speed

Add bus handling function

It is much more handy to work with data/address buses as with whole 4-8-16-32-64 bit object/variable, not with separate pins.
Also it will be useful to add callbacks to bus state

dbg.dll.lua example script

The code in the repository for example dbg.dll.lua, function device_simulate() is empty:

function device_simulate()

end

It should be:

function device_simulate()
for i = 0, 7 do
if 1 == get_pin_bool(_G["D"..i]) then
DATA_BUS = set_bit(DATA_BUS, i)
else
DATA_BUS = clear_bit(DATA_BUS, i)
end
end
uart_send(string.format("[%d] Fetched opcode %.2X\r\n", systime(), DATA_BUS))
end

With that change (found by google-fu) everything is working great. Very impressed with the project!!

Something wrong with get_pin_bool

The sample script addr.lua works weird:
The timing seems to be 2 times slower I expect. But callback function is called just in time, so nothing wrong with callback itself.

SystemC support

It must be interesting to add SystemC support while simulating devices in C. It is unclear at the moment if it make sense, but it worth to investigate it

Migration to Lua 5.3 failed

Lua 5.3 provides new functions, like bitwise and number conversion which are custom implemented at the moment. And it greatly degrade performance. Also new Lua represent numbers as 64 bits by default.
Many old functions used by openvsm are now obsolete and need to be replaced. Compilation also fails.

Multiple copies of the same model don't work

See branch patch-1 testcases in my fork. It contains a V7 schematic and a simple multi-part device (7408) script.

Only 1 part of a multi-part device simulates at a time even across devices
Not sure if I did something wrong with the model script or there is an issue with openVSM.

Did not want to pull this if it is my fault.

P2V VSM models

Ability to connect real device to as VSM model via SWIM interface

Need to find out how to use VDM API

According to official manual, help and instructions about how to use VSM is sending personally.
VDM provides a lot of usefull functions to model CPU-like devices. In order not to reinvent the wheel it is better to reverse some existing DLL or maybe to find the manual (no go) or may be there is source code for some CPU model from electronics enthusiasts.

Overload for bus/pin set and get methods

In current openvsm realization bus/pin states are set with specific functions like set_pin_bool or set_bus.
Much better to create metatables with custom functions using default metamethods like __add __call etc.

Add operation sequencer function

In order to make operation timing easier, there should be function that accept table of timings/operation flowchart and will automatically set callbacks and provide corresponding pin check

Add ability to disable safe mode

While safe mode

static void SAFE_EXECUTE ( lua_State* L, void* curfunc )

provides easy debug, it degrades performance of entire model. Run mode should be customizable inside the script.

Example DLL source code

Great works! Would it be possible to include the source code for the example DLLs (Addr.dll, Dbg.dll and k573.dll)? This would be helpful to see how all the parts all fit together.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.