Skip to content

Getting Started

Harith-Y edited this page Dec 14, 2024 · 1 revision

Getting Started

This page gives an insight on how to run the project.

Prerequisites

To compile and run this project, you need:

  • C++ compiler supporting C++11 or later (e.g., GCC/G++)
  • CMake (optional for build automation)
  • Basic understanding of Digital Circuits

Note: Now the Project can be compiled and run using just 2 commands and clear all the cache files in 1 command using MakeFile concept.

Tests will be implemented soon.

Running the Project

Make sure you have cloned the GitHub repo into your local system if you have not already:

git clone https://github.com/Prometheus052404/CIRCUIT.git

Use the below commands in Git Bash at your Project's Root Directory:

git fetch
git pull

As you have made sure that you're up-to-date, you are now ready to continue ahead!

Manual Compilation

  1. Navigate to the project directory:

    cd DigitalLogicSimulator
  2. Compile the project:

    g++ src/*.cpp main.cpp -o simulator
  3. Run the executable:

    ./simulator

Using CMake (Optional)

  1. Create a 'build' directory:

    mkdir build && cd build
  2. Generate Makefiles from CMake:

    cmake ..
  3. Build using Make:

    make
  4. Run the program:

    ./bin/DigitalLogicSimulator

Using Make (Optional)

Note: Skip this section if make --version gives desired output in your git bash

If you are using Windows and have wsl installed, but not make, then follow the below steps:

  • Go to ezwinports, i.e. https://sourceforge.net/projects/ezwinports/files/
  • Download make-4.1-2-without-guile-w32-bin.zip (get the version without guile)
  • Extract zip
  • Copy the contents to C:\Program Files\Git\mingw64\ merging the folders, but do NOT overwrite/replace any exisiting files.

If you are using Ubuntu/Debian,

  • Open WSL and update the package list:

    sudo apt update
  • Install make:

    sudo apt install make

Navigate to your project directory within WSL and run make. OR

sudo apt install build-essential

build-essential includes make and other essential development tools like gcc and g++.

For MacOS,

  • If you have Homebrew installed, you can install make with:
    brew install make

Verify Installation

  • Open a new Git Bash window to refresh your PATH.
  • Run:
    make --version

This should display the version of make if it’s installed correctly.

Implementation

Create the Project using Makefile:

make

Execute the code:

./DCSimulator

Remove all the build / cache files:

make clean

Note: Run the above commands in git bash, at the project's root directory.

Clone this wiki locally