Created
August 19, 2021 08:41
-
-
Save thoughtpolice/de3510502a94776d187f21afb09257e8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env bluetcl | |
# bsc-libdir: a tcl script that looks up Verilog primitives for | |
# the bluespec compiler, and emits them to stdout. this tool | |
# is more useful when combined with `bsc-rpc`, but might be | |
# of use on its own. | |
# | |
# usage: | |
# | |
# $ bluetcl bsc-libdir RegUN > RegUN.v | |
# $ bluetcl bsc-libdir BRAM1Load > BRAM1Load.v | |
if { $argc != 1 } { | |
puts "ERROR: module name must be provided" | |
exit 1 | |
} | |
set vmod [lindex $argv 0] | |
set modpath "${env(BLUESPECDIR)}/Verilog/${vmod}.v" | |
if { [file exist "${modpath}"] != 1 } { | |
puts "ERROR: bluespec primitive module ${vmod} does not exist!" | |
exit 1 | |
} | |
set fp [open $modpath r] | |
set contents [read $fp] | |
close $fp | |
puts -nonewline "${contents}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment