Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import os
import sys
import logging
from collections import OrderedDict
from edalize.edatool import Edatool
logger = logging.getLogger(__name__)
class Vunit(Edatool):
argtypes = ["cmdlinearg"]
testrunner_template = "run.py.j2"
testrunner = "run.py"
@classmethod
def get_doc(cls, api_ver):
if api_ver == 0:
return {
"description": "VUnit testing framework",
"members": [
{
"name": "vunit_runner",
"type": "String",
"desc": 'Name of the Python file exporting a "VUnitRunner" class that is used to configure and execute test',
}
],
import logging
import os.path
from edalize.edatool import Edatool
logger = logging.getLogger(__name__)
class Ghdl(Edatool):
argtypes = ['vlogparam', 'generic']
@classmethod
def get_doc(cls, api_ver):
if api_ver == 0:
return {'description' : "GHDL is an open source VHDL simulator, which fully supports IEEE 1076-1987, IEEE 1076-1993, IEE 1076-2002 and partially the 1076-2008 version of VHDL",
'lists' : [
{'name' : 'analyze_options',
'type' : 'String',
'desc' : 'Options to use for the import (ghdl -i) and make (ghdl -m) phases'},
{'name' : 'run_options',
'type' : 'String',
'desc' : 'Options to use for the run (ghdl -r) phase'},
]}
import os
import logging
from edalize.edatool import Edatool
logger = logging.getLogger(__name__)
class Icarus(Edatool):
tool_options = {
'members' : {'timescale' : 'String'},
'lists' : {'iverilog_options' : 'String'}
}
argtypes = ['plusarg', 'vlogdefine', 'vlogparam']
MAKEFILE_TEMPLATE = """
all: $(VPI_MODULES) $(TARGET)
$(TARGET):
iverilog -s$(TOPLEVEL) -c $(TARGET).scr -o $@ $(IVERILOG_OPTIONS)
run: $(VPI_MODULES) $(TARGET)
vvp -n -M. -l icarus.log -lxt2 $(patsubst %.vpi,-m%,$(VPI_MODULES)) $(TARGET) $(EXTRA_OPTIONS)
import os
import logging
from edalize.edatool import Edatool
logger = logging.getLogger(__name__)
RUN_DO = """#Generated by Edalize
run -all
exit
"""
class Rivierapro(Edatool):
tool_options = {'lists' : {'vlog_options' : 'String',
'vsim_options' : 'String'}}
argtypes = ['plusarg', 'vlogdefine', 'vlogparam']
def _write_build_rtl_tcl_file(self, tcl_main):
tcl_build_rtl = open(os.path.join(self.work_root, "edalize_build_rtl.tcl"), 'w')
(src_files, incdirs) = self._get_fileset_files()
vlog_include_dirs = ['+incdir+'+d.replace('\\','/') for d in incdirs]
libs = []
for f in src_files:
if not f.logical_name:
f.logical_name = 'work'
import os
import logging
from edalize.edatool import Edatool
logger = logging.getLogger(__name__)
class Isim(Edatool):
tool_options = {'lists' : {'fuse_options' : 'String',
'isim_options' : 'String'}}
argtypes = ['plusarg', 'vlogdefine', 'vlogparam']
MAKEFILE_TEMPLATE="""#Auto generated by Edalize
include config.mk
all: $(TARGET)
$(TARGET):
fuse $(TOPLEVEL) -prj $(TARGET).prj -o $(TARGET) $(VLOG_DEFINES) $(VLOG_INCLUDES) $(VLOG_PARAMS) $(FUSE_OPTIONS)
run: $(TARGET)
./$(TARGET) -tclbatch run_$(TARGET).tcl $(ISIM_OPTIONS) $(EXTRA_OPTIONS)
import logging
import re
import os
from collections import OrderedDict
from edalize.edatool import Edatool
logger = logging.getLogger(__name__)
class Ascentlint(Edatool):
argtypes = ['vlogdefine', 'vlogparam']
@classmethod
def get_doc(cls, api_ver):
if api_ver == 0:
return {'description' : """ Real Intent Ascent Lint backend
Ascent Lint performs static source code analysis on HDL code and checks for
common coding errors or coding style violations.
""",
'lists' : [
{'name' : 'ascentlint_options',
'type' : 'String',
'desc' : 'Additional run options for ascentlint'}
]}
import logging
import os.path
from edalize.edatool import Edatool
logger = logging.getLogger(__name__)
class Ghdl(Edatool):
tool_options = {'lists' : {'analyze_options' : 'String',
'run_options' : 'String'}}
argtypes = ['vlogparam']
def configure_main(self):
(src_files, incdirs) = self._get_fileset_files()
# ghdl does not support mixing incompatible versions
# specifying 93c as std should allow 87 syntax
# 2008 can't be combined so try to parse everthing with 08 std
has87 = has93 = has08 = False
for f in src_files:
if f.file_type == "vhdlSource-87":
has87 = True
elif f.file_type == "vhdlSource-93":
has93 = True
#Assume a local installation if VERILATOR_ROOT is set
ifeq ($(VERILATOR_ROOT),)
VERILATOR ?= verilator
else
VERILATOR ?= $(VERILATOR_ROOT)/bin/verilator
endif
V$(TOP_MODULE): V$(TOP_MODULE).mk
$(MAKE) -f $<
V$(TOP_MODULE).mk:
$(VERILATOR) -f $(VC_FILE) $(VERILATOR_OPTIONS)
"""
class Verilator(Edatool):
tool_options = {'members' : {'mode' : 'String',
'cli_parser' : 'String'},
'lists' : {'libs' : 'String',
'verilator_options' : 'String'}}
argtypes = ['cmdlinearg', 'plusarg', 'vlogdefine', 'vlogparam']
def _managed_parser(self):
return not 'cli_parser' in self.tool_options or self.tool_options['cli_parser'] == 'managed'
def configure_pre(self, args):
if self._managed_parser():
self.parse_args(args, self.argtypes)
def configure_main(self):
import logging
import re
import os
import subprocess
from edalize.edatool import Edatool
logger = logging.getLogger(__name__)
class Veriblelint(Edatool):
argtypes = ['vlogdefine', 'vlogparam']
@classmethod
def get_doc(cls, api_ver):
if api_ver == 0:
return {'description' : "Verible lint backend (verilog_lint)",
'members': [
{'name': 'ruleset',
'type': 'String',
'desc': 'Ruleset: [default|all|none]'},
],
'lists': [
{'name' : 'verible_lint_args',
'type' : 'String',
'desc' : 'Extra command line arguments passed to the Verible tool'},
import os.path
from edalize.edatool import Edatool
class Yosys(Edatool):
argtypes = ['vlogdefine', 'vlogparam']
@classmethod
def get_doc(cls, api_ver):
if api_ver == 0:
return {'description' : "Open source synthesis tool targeting many different FPGAs",
'members' : [
{'name' : 'arch',
'type' : 'String',
'desc' : 'Target architecture. Legal values are *xilinx*, *ice40* and *ecp5*'},
{'name' : 'output_format',
'type' : 'String',
'desc' : 'Output file format. Legal values are *json*, *edif*, *blif*'},
{'name' : 'yosys_as_subtool',
'type' : 'bool',