Git Product home page Git Product logo

justag's Introduction

JustTAG

Installation

> git clone https://github.com/StanfordVLSI/JusTAG.git
> cd JusTAG
> pip install -e .

justag's People

Contributors

sgherbst avatar zamyers avatar

Stargazers

a_p_u_r_o avatar  avatar

Watchers

Nikhil Bhagdikar avatar  avatar James Cloos avatar Steven Bell avatar Jing Pu avatar  avatar  avatar Jonathan Leaf avatar Byongchan Lim avatar  avatar Megan Wachs avatar

Forkers

0xbadcoffe

justag's Issues

Identify files by extension rather than parent directory

At the moment, the arguments given to JusTAG are identified as SystemVerilog packages vs. Markdown files based on the name of the parent directory (all or reg). I found this a bit non-intuitive when I started using JustTAG, since I didn't expect that the naming of the files paths would affect how they are processed (plus, it's nice to have flexibility to organize files based on project-specific preferences). As one possible solution, we could process ".v"/".sv" files as packages and "*.md" files are processed as Markdown.

Here's the associated code snippet dealing with file ID

JusTAG/JusTAG.py

Lines 19 to 28 in 58bd528

sort_files = {
'reg' : interfaces,
'all' : const_packs
}
for dir_file_name in list_of_files:
tokens = dir_file_name.strip().split('/')
directory = tokens[-2]
file_name = tokens[-1]
sort_files[directory][dir_file_name] = []

Consider releasing on PyPI?

I think it would be awesome if JusTAG could be installed from PyPI with something like pip install justag.

If this interests you, there are a couple of sub-tasks:

  1. Move folders outside of justag (like rtl and verif) into justag, since that is the folder that will be installed by pip.
  2. There are various options to include non-Python files in the source distribution (e.g., *.svp files), but I tend to use a top-level file called MANIFEST.in like this example from anasymod:
    https://github.com/sgherbst/anasymod/blob/bbaa0c60f0c0657f6b105f62ae0f09b6f1a22dd4/MANIFEST.in#L1-L2
  3. To make JustTAG.py available as a script that can be called directly by the user (i.e., JustTAG instead of python $JUSTAG_DIR/JustTAG.py), you can use entry_points in setup.py like this example from anasymod:
    https://github.com/sgherbst/anasymod/blob/bbaa0c60f0c0657f6b105f62ae0f09b6f1a22dd4/setup.py#L24-L28
  4. To release the package, create an account on PyPI and then run these commands in the top level of the repo (the first command only needs to be run once, and the last command will prompt for your PyPI credentials). Note that each release must have a unique version number, which you can achieve by bumping the version number in setup.py
> pip install twine
> python setup.py sdist
> twine upload dist/*
  1. If you want to integrate PyPI releases with continuous integration tools, you can use GitHub actions like this example from msdsl: https://github.com/sgherbst/msdsl/blob/master/.github/workflows/release.yml. The idea is that you store your PyPI credentials in GitHub secrets for use in the release script that is triggered by git tags starting with "v" (please be sure to use a password that isn't used elsewhere, just in case...). Then you can release packages like this:
# first change setup.py to version 0.1.2
> git commit -am "release 0.1.2"
> git tag v0.1.2
> git push origin v0.1.2
> git push origin master
  1. For a pretty minimal example that illustrates all of these items (except MANIFEST.in), you could take a look at my elevation data project pyhigh

Allow the user to specify the JTAG ID

The tap template allows the user to specify version[3:0] (valid range 0 through 15), part[15:0] (valid range 0 through 65535), and man_num[10:0] (valid range 0 through 2047):

.version(`$version`),
.part(`$part`),
.man_num(`$man_num`),

These are taken together to form the JTAG ID (note that the LSB is always "1")

logic [31:0] id_code = {version, part, man_num, 1'b1};

It would be great it the user could optionally specify these parameters. This would allow them to do things like encode the git commit hash in the ID for debugging purposes. This feature could be exposed as optional command-line arguments (something like justag --version NNNN --part NNNN --man_num NNNN file1 file2 ...).

Right now, it might be a little cumbersome to add these command-line options because sys.argv is read directly:

list_of_files = sys.argv[1:]

However I think if this is changed to an ArgumentParser-based approach, it should be relatively quick. By the way, please validate the user input for these three arguments to ensure that they fall within the allowed range of values. Thanks!

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.