https://github.com/imperialcollegelondon/hdl_editor
Interactive Hardware Description Language/Block Diagram Editor
Science Score: 13.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (12.5%) to scientific vocabulary
Repository
Interactive Hardware Description Language/Block Diagram Editor
Basic Info
- Host: GitHub
- Owner: ImperialCollegeLondon
- License: mit
- Language: F#
- Default Branch: master
- Size: 6.02 MB
Statistics
- Stars: 5
- Watchers: 3
- Forks: 4
- Open Issues: 31
- Releases: 1
Metadata Files
README.md
HDL Editor
Introduction
The application is designed to generate structured Verilog HDL (Hardware Description Language) code for FPGA devices. The output Verilog code is fully synchronous.
The application is implemented in F#. The source code is transpiled to JavaScript by the Fable compiler and bundled by webpack. The result JavaScript code runs under the Electron framework with GUI set by HTML and CSS files.
The application uses JointJS, a drawing library implemented in JavaScript, to handle the graphical design interface.
Feature
The software is a graphical design tool for FPGA hardware design. For creating custom logic blocks, user can either fill in truth tables to generate standalone blocks, or connect different logic blocks together to form a higher level block.
The application is designed to be cross-platform, either for production use or development purposes.
Although the source code is in F#, interop with JavaScript is made possible by Fable.
Code Structure
The F# source code is placed in three projects and transpiled to three pieces of JavaScript code. Each piece of JavaScript code consists of two files: one minimized file and one mapping file.
The electron main process handles tasks such as creating windows and providing browser-like platform to run the code. Each Electron application instance can has only one main process.
The electron renderer process handles tasks such as GUI update and user interaction. The number of renderer processes is not limited in one Electron application instance.
The two kinds of processes can communicate with each other via IPC (Inter-Process Communication) calls or via the Remove module, which is a one way communication from the renderer process to the main process.
| Process | Project | Source | Executable Code | |-------------------|--------------------------------------------------------|---------------------------------|----------------------------------| | electron main | .src/Main/Main.fsproj | .src/Main/Main.fs | .app/js/main.js | | electron renderer | .src/Renderer/Renderer.fsproj | .src/Renderer/.fs | .app/js/renderer.js | | electron renderer | .src/blockConfigureWindow /blockConfigureWindow.fsproj | .src/blockConfigureWindow /.fs | .app/js /blockConfigureWindow.js |
The ordering of the F# source code files is controlled by the .fsproj files. The .fsproj files are passed in when transpiling to JavaScript.
package.json
The electron framework is built upon Node.js and follows the typical file structure for a Node project.
The package.json is the configuration file for the project, including information such as package dependency, scripts and copyright.
{
...
"scripts": {
"start": "cd src/Main && yarn webpack --port free -w --config webpack.config.js -w",
"build": "cd src/Main && yarn webpack --port free --config webpack.config.js",
"launch": "electron . -w",
},
...
}
The script section in package.json defines shortcut commands. To run the defined commands, simply type yarn + <script key> in the terminal followed by the Enter key. To use the yarn commands, yarn needs to be installed.
Native node npm commands are also supported. To run the defined shortcut commands, type npm run <script key> followed by the Enter key.
webpack.config.js
The file is used to configure webpack, the bundler. The file sets the entry point and the output directory for different F# projects.
Webpack configuration is loaded when yarn start is running in the command line interface. The webpack can be configured to watch any changes in the source file and automatically re-bundle.
If the webpack configuration file is changed, the yarn start process needs to be restarted in order to allow the changes to take effect.
File Structure
app folder
The folder contains the HTML and CSS files for setting and styling the GUI. The CSS files are put in a separate folder called css/.
The transpiled JavaScript code is put in the js/ subfolder, as configured in the webpack.config.js file.
src folder
The folder contains F# projects. Each F# project is put in a subfolder. The structure of each subfolder is auto-generated by Visual Studio.
Getting Started
You can skip this section if you just wanted to run the application. Please head to the release section of this repo to get the packaged application.
Install Node.js.
Install yarn.
Install Mono if you were using Mac or Linux. Ensure Mono is downloaded from the official website.
Install the Dotnet SDK.
Clone the source code repo.
Run
yarn installto install the npm packages.Install paket if you were using Mac or Linux.
Run
setup.batif under Windows orsetup.shif under Mac or Linux.Open one terminal,
cdto the source code root directory and runyarn start. Wait for all the source code to compile. Errors in source code is shown in color text in the terminal.Open another terminal,
cdto the source code root directory and runyarn launch. The application should launch now.In the application window, press
Ctrl-Shift-Ito toggle the dev tool.Refer to the
Packaging the Applicationsection in this README.md file if you wanted to pack the application for production use.
Reinstalling Compiler and Libraries
For Windows users, run setup.bat file at the root directory.
For Mac and Linux users, run setup.sh file at the root directory.
Packaging the Application
| Operating System | Command |
|------------------|-------------------|
| Windows | yarn pack-win |
| Mac | yarn pack-mac |
| Linux | yarn pack-linux |
Please run each command under its corresponding operating system.
Dependency Upgrade
The project uses the Fable 2.0.3. At the time of development, Fable 3 is under development while not officially released.
JointJS version 2.2.1. Its commercial extension Rappid is not needed.
Electron version 4.1.3
Dotnet SDK version 2.1
Webpack version 4.29.6
Boilplate Development
The F# projects are controlled by the HDL_Editor.sln file, which is used as the Visual Studio solution file. By openning the file using Visual Studio, all F# projects are accessible in one window.
Open two terminals with one running yarn start and the other running yarn launch. When any changes are made to the F# source code, saving the changes will trigger the automatic re-transpile of the changed files. The yarn launch command needs to be stopped and re-run to make the changes in the source code take effect.
Licensing
The application is licensed under the MIT license.
Owner
- Name: Imperial College London
- Login: ImperialCollegeLondon
- Kind: organization
- Email: icgithub-support@imperial.ac.uk
- Location: Imperial College London
- Repositories: 311
- Profile: https://github.com/ImperialCollegeLondon
Imperial College main code repository
GitHub Events
Total
- Watch event: 1
Last Year
- Watch event: 1
Issues and Pull Requests
Last synced: over 1 year ago
All Time
- Total issues: 4
- Total pull requests: 43
- Average time to close issues: N/A
- Average time to close pull requests: 8 months
- Total issue authors: 2
- Total pull request authors: 1
- Average comments per issue: 0.0
- Average comments per pull request: 0.37
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 43
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- icorgadmin (3)
- Spinhoda (1)
Pull Request Authors
- dependabot[bot] (42)
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- 818 dependencies
- @babel/core ^7.4.3 development
- @babel/plugin-transform-runtime ^7.4.3 development
- @babel/preset-env ^7.4.3 development
- @babel/preset-react ^7.0.0 development
- @babel/register ^7.4.0 development
- babel-loader ^8.0.5 development
- babel-plugin-istanbul ^5.1.4 development
- cross-env ^5.2.0 development
- css-loader ^2.1.1 development
- electron ^4.1.3 development
- electron-chromedriver ^6.0.0-beta.3 development
- electron-packager ^13.1.1 development
- fable-compiler ^2.2.3 development
- fable-loader ^2.1.5 development
- loglevel ^1.4.1 development
- mocha ^6.1.4 development
- mocha-junit-reporter ^1.22.0 development
- nyc ^14.1.1 development
- spectron ^5.0.0 development
- style-loader ^0.23.1 development
- webpack ^4.29.6 development
- webpack-cli ^3.3.0 development
- @babel/runtime ^7.4.3
- jointjs ^2.2.1
- 841 dependencies
- Dotnet.ProjInfo 0.35
- FSharp.Compiler.Service 29.0.1
- FSharp.Core 4.6.2
- Fable.Core 2.0.3
- Fable.Import.Browser 1.3
- Fable.Import.Electron 0.1.1
- Fable.Import.Mocha 0.1
- Fable.Import.Node 0.4.3
- Fable.PowerPack 3.0
- Microsoft.NETCore.App 2.2.5
- Microsoft.NETCore.DotNetAppHost 2.2.5
- Microsoft.NETCore.DotNetHostPolicy 2.2.5
- Microsoft.NETCore.DotNetHostResolver 2.2.5
- Microsoft.NETCore.Platforms 2.2.1
- Microsoft.NETCore.Targets 2.1
- NETStandard.Library 2.0.3
- Newtonsoft.Json 12.0.2
- System.Collections 4.3
- System.Collections.Concurrent 4.3
- System.Collections.Immutable 1.5
- System.Diagnostics.Debug 4.3
- System.Diagnostics.Process 4.3
- System.Diagnostics.TraceSource 4.3
- System.Diagnostics.Tracing 4.3
- System.Globalization 4.3
- System.IO 4.3
- System.Linq 4.3
- System.Reflection 4.3
- System.Reflection.Emit 4.3
- System.Reflection.Emit.ILGeneration 4.3
- System.Reflection.Metadata 1.6
- System.Reflection.Primitives 4.3
- System.Reflection.TypeExtensions 4.5.1
- System.Resources.ResourceManager 4.3
- System.Runtime 4.3.1
- System.Runtime.Extensions 4.3.1
- System.Runtime.Handles 4.3
- System.Runtime.InteropServices 4.3
- System.Runtime.Loader 4.3
- System.Security.Cryptography.Algorithms 4.3.1
- System.Security.Cryptography.Encoding 4.3
- System.Security.Cryptography.Primitives 4.3
- System.Text.Encoding 4.3
- System.Threading 4.3
- System.Threading.Tasks 4.3
- System.ValueTuple 4.5
- Thoth.Json 2.5
- dotnet-fable 2.0.11
- runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.3
- runtime.debian.9-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.3
- runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.3
- runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.3
- runtime.fedora.27-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.3
- runtime.fedora.28-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.3
- runtime.native.System 4.3.1
- runtime.native.System.Security.Cryptography.OpenSsl 4.3.3
- runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.3
- runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.3
- runtime.opensuse.42.3-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.3
- runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.3
- runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.3
- runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.3
- runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.3
- runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.3
- runtime.ubuntu.18.04-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.3