Skip to content

eatonphil/LSA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Logisim Static Analysis Tool - LSA

This is a tool to statically analyze logisim circuits. You can use this in conjunction with the new STDL (discussed below) to count transistors and get other information statically available.

STDL - Standard Library

This library re-implements the Logisim standard library from the ground up building from CMOS logic universal gates. As a result, some of the larger circuits (i.e. Multiplexer16x16) can be VERY slow because of the poor way memory is handled in Logisim. This library is one way to get a transistor count for all elements used in Logisim circuits. Unfortunately, arbitrary bit-width or input-number gates are currently impossible in Logisim. They were only possible in the standard library because the author could "cheat" by making API calls to functions in Java.

Mostly, this library was a fun chance to learn more about circuits in a hands on manner. The library does NOT NEED TO BE USED to get the transistor count. The lsa program provides lookups for many components. Support for more components will continue to grow in time.

Setup & Usage

Setup

Add the folder to the path. This is necessary to make sure the STDL circuits are available to the lsa application.

lsa circuit-file [circuit-name]

Where circuit-name defaults to "main". This can be changed to narrowly target a specific circuit/sub-circuit within a file.

This creates a few lsa files, currently: transistors.lsa and unused.lsa.

WARNING: This will fail if a component is used that is not yet supported (reimplemented in the STDL) by lsa.

Example

From the lsa directory:

./lsa tests/vendor/emcdowell/RightShift.circ
cat transistors.lsa
cat unused.lsa

Testing

To run all tests:

python test.py

Generated Files

transistors.lsa

This file contains a list of all components used and their transistor counts. Components are separated by sub-circuits and sub-total transistor counts are listed at the end of each sub-section.

unused.lsa

This file displays any unused circuits in the circuit.

WARNING: The lsa program is easily tricked. An unconnected circuit or component that is placed in or referenced (recursively) by circuit-name (second argument to ./lsa) will be counted as a connected circuit or component.

Dependencies

This repo is guarenteed to run correctly on python 2.7. It has not yet been tried on python 3.x.

Other Notes

This tool and library is still in its infancy. Please report any bugs!

About

A tool (and reimplementation of the Logisim standard library) for static circuit analysis of Logisim designs.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages