-
Notifications
You must be signed in to change notification settings - Fork 11
/
generators.core
119 lines (101 loc) · 5.43 KB
/
generators.core
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
CAPI=2:
name: fusesoc:utils:generators:0.1.7
generators:
custom:
interpreter: python3
command: custom.py
description: Run custom command
usage: |
The custom generator allows the user to specify a custom command to run.
As the custom generator doesn't know by itself what is produced by the
command, the user is requrested to specify any created files and associated
plusargs, defines etc in the output configuration parameter.
Parameters:
command (str): The command to run. Working directory for the command is
determined by the copy_core and run_from_core parameters
copy_core (bool): Copy the working directory to a temporary location and run
the command from there
run_from_core (bool): Runs command from the directory specified as files_root
in the configuration file
output (dict): A dictionary describing the expected output from the command.
These are written to the generated .core file
files (list): A list of files, specified in the same format as CAPI2 fileset
files, which are expected to be generated by the command
parameters (dict): A map of parameters, specified in the same format as
CAPI2 parameters, which are used by the generated files
gitversion:
interpreter: python3
command: gitversion.py
description: Parse version tags from git repo
usage: |
The gitversion generator runs git describe to look at the tags in the current
directory (or in files_root if that is defined in the input configuration file)
and creates verilog defines that can be used in a core to provide accurate
version information.
Tags are assumed to be on the format vx.y.z which produces the following defines
VERSION_MAJOR = x
VERSION_MINOR = y
VERSION_PATCH = z
In addition to the parsed tags, the gitversion generator will also set
VERSION_REV to the number of commits since the last tag and VERSION_DIRTY if
it detects that there are local modifications in the repository
icepll:
interpreter: python3
command: icepll.py
description: Generate a parameterized verilog wrapper for an iCE40 PLL
usage: |
The icepll generator is a simple wrapper around the icepll command
Parameters:
freq_in (int): PLL Input Frequency (default: 12 MHz)
freq_out (int) PLL Output Frequency (default: 60 MHz)
filename (str): Output filename (default: pll.v)
module (bool): If true, generate a verilog module which instantiates the PLL.
Otherwise, the user is responsible for instantiating the PLL
and the icepll generator will create a list of parameters that
can be included in the parameter list of the user-instantiated
component (default: false)
template:
interpreter: python3
command: template/template_generator.py
description: Generate a file from a Jinja template
usage: |
The template generator uses the provided YAML description to populate
a Jinja template.
The generator requires the following parameters:
output_file:
name: The file name for the rendered template
type: The file type of the rendered template (vhdlSource, verilogSource, etc.)
template: The file name of the template
template_path (optional): The directory containing the template.
If this parameter isn't specified the default is to use the
calling core's directory followed by the templates
directory for this generator.
Examples of template usage are in the examples directory.
chisel:
interpreter: python3
command: chisel.py
description: Build Chisel HDL
usage: |
This generator builds chisel HDL generating Verilog output.
The generator depends on the Mill or SBT build configs and require the
host to have all pre-reqs like a Java Virtual Machine to build Chisel/Scala
applications.
The user is required to specify any created files and associated
arguments and parameters.
Parameters:
buildtool (str): The Scala build tool to be used (Mill or SBT).
Requires respective "build.sc" or "build.sbt".
env (str): Environment variables to be passed to the Chisel build tool.
outputdir (str): Output directory to be passed to build tool for generated
verilog files from Chisel sources. Must match path used in
"output: files:" section.
extraargs (str): Extra arguments to be passed to the build tool.
chiselproject (str): Chisel project name to be passed to the build tool.
copy_core (bool): Copy the working directory to a temporary location and run
the command from there
output (dict): A dictionary describing the expected output from the command.
These are written to the generated .core file
files (list): A list of files, specified in the same format as CAPI2 fileset
files, which are expected to be generated by the command
parameters (dict): A map of parameters, specified in the same format as
CAPI2 parameters, which are used by the generated files