Coder Social home page Coder Social logo

ajit3259 / port-of-simavr Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sarthaksarm/port-of-simavr

0.0 1.0 0.0 6.89 MB

This is the port of a tool, SimAVR (1280 mcu) which thus, can be accessed on web as a simulator for simulation and debugging of AVR codes.

Home Page: https://sarthaksarm.github.io/Port-of-SimAVR/

CMake 0.26% Makefile 1.47% C 17.12% JavaScript 79.97% Shell 0.01% Python 0.04% Objective-C 0.86% C++ 0.13% HTML 0.12% CSS 0.03%

port-of-simavr's Introduction

Port-of-SimAVR

Like many MicroControllers available namely 8051, 8031 etc which basically uses C(embedded C) code, we also have others like Atmel ATMega 1280 mcu(Micro Controller Unit) which uses AVR codes. Like other programming, Programming in AVR also needs knowledge about its syntax but its like impractical to say that ‘errors won’t be arised’. So, as a debugger and also many a times simulation of such programs in the absenceof actual hardware, so here comes the need of some debugging tool or software which can help us to do so for which we have “SimAVR”.
SimAVR comes as an github repository from which it needs to be cloned first and then installation of a software named GTKWave is required for simulation. As we know, it is not really practical and possible to have all necessary machine requirements, memory space, time and most importantly patience to download, install and follow their “ReadMe”. In this modern era of mobile phones, which are much more handy than laptops or systems. Thus, we found the need of an hour and so we here present Port of SimAVR to make it accessible through web on every device(even on, thus, phones) at no cost of installation memory, time or patience.

COMPILING

1. Install emsripten SDK from its official website, https://emscripten.org/docs/getting_started/downloads.html .
2. Clone our repository.
3. Change directory to "CodeBase" and configure cmake file and make necessary builds to take place.
>>cd CodeBase
>>emconfigure cmake

4. Update link.txt file to make it generate js without wasm, passing necessary flags to emcc command as:
-s ASM_JS=1 -s WASM=0 -s FORCE_FILESYSTEM=1 -s ERROR_ON_UNDEFINED_SYMBOLS=0 -s EXTRA_EXPORTED_RUNTIME_METHODS=’[“ccall”,”cwrap”,”ALLOC_NORMAL”]’
5. Now run the build file by command:
>>emmake make

6. Replace the js file generated, namely, "simavr.js", into the "Front_End" directory.
7. Run Python Server in current directory i.e "Front_End", to serve it locally on your machine.

How to use?

1. This is Port of Atmel ATMega1280 mcu(Micro Control Unit) which has 11 in total Ports(PA, PB, ...PK, excluding PI) for connection acc. to its Pin-Outs. Each Port having 8 pins and thus its LEDs representation.
2. To convert an elf file into hex file, use command:
>>avr-objcopy -j .text -j .data -O ihex main.elf main.hex

3. To increase the simulation speed on the cost of higher CPU utilization, slider can be used.
4. To stop the simulation process at some point of time, "Abort Simulation" can be used.
5. To Debug AVR codes using it, upload a generated file in .hex format(generating from AVR codes).
The simulation is being shown in form of LEDs which is the first and direct visual sign of debugging, as comparing the results with as expected and shown. 6. Ouput Terminal can be used to debug as the second approach i.e the precise and accurate details which highlights the points which may help to debug namely no. of machine cycles taken by instructions, time delay, time taken in execution of each cycle etc. (depending upon hardware being used). Better interpretation out of it, may validate the input in just one go!

System Specifications(While Porting)

Working Machine: Ubuntu 18.04
Emscripten version used: emcc 1.38.36

LIMITATIONS

  1. The port supports especially ATMega 1280 mcu, thus other versions of mcu are not supported.
  2. Rendering of LCD screen i.e Graphic representation is not available. However, mostly information is being printed on terminal at this stage to simplify debug process.
  3. The timing is fixed as described for the 5V-versions.
  4. Only .hex file format is acceptable. However, command has been provided to convert an elf file into .hex .

Access PORT

The port is accessible at https://sarthaksarm.github.io/Port-of-SimAVR/

CONTRIBUTING

We welcome the patches. Please submit your changes by Pull requests.

ORIGINAL

As this is a port, the original, official SimAVR can be found at https://github.com/buserror/simavr .

port-of-simavr's People

Contributors

sarthaksarm avatar soniakash1998 avatar

Watchers

James Cloos avatar

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.