-
Notifications
You must be signed in to change notification settings - Fork 182
Added gatemate vendor and Updated init file #1460
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
fd61e4d
0580d1a
95bea8a
ceeca1f
1eb3001
e3e65f8
4a2b7da
ed3f252
857d8e7
c3b8f9c
231bbda
59861aa
9c0e84b
3760be1
0505ca5
9a82d53
f639850
006ca56
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,120 @@ | ||||||||
from abc import abstractmethod | ||||||||
from amaranth import * | ||||||||
from amaranth.build import * | ||||||||
from amaranth.lib.cdc import ResetSynchronizer | ||||||||
|
||||||||
__all__ = ["GateMatePlatform"] | ||||||||
|
||||||||
whitequark marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||
class GateMatePlatform(TemplatedPlatform): | ||||||||
""" | ||||||||
.. rubric:: GateMate FPGA toolchain | ||||||||
whitequark marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||
Required tools: | ||||||||
* ``yosys`` | ||||||||
* ``p_r`` | ||||||||
The environment is populated by setting the ``CC_TOOL`` environment variable to point to the toolchain directory. | ||||||||
|
||||||||
""" | ||||||||
|
||||||||
device = property(abstractmethod(lambda: None)) | ||||||||
package = property(abstractmethod(lambda: None)) | ||||||||
|
||||||||
|
||||||||
toolchain = "GateMate" | ||||||||
|
||||||||
required_tools = [ | ||||||||
"yosys", | ||||||||
"p_r", | ||||||||
] | ||||||||
|
||||||||
file_templates = { | ||||||||
**TemplatedPlatform.build_script_templates, | ||||||||
"{{name}}.v": r""" | ||||||||
/* {{autogenerated}} */ | ||||||||
{{emit_verilog()}} | ||||||||
|
||||||||
""", | ||||||||
"{{name}}.debug.v": r""" | ||||||||
/* {{autogenerated}} */ | ||||||||
{{emit_debug_verilog()}} | ||||||||
""", | ||||||||
"{{name}}.ccf": r""" | ||||||||
# {{autogenerated}} | ||||||||
{% for port_name, pin_name, attrs in platform.iter_port_constraints_bits() -%} | ||||||||
Net "{{port_name}}" Loc = "{{pin_name}}" | ||||||||
{%- set constraints = [ | ||||||||
"SCHMITT_TRIGGER", "PULLUP", "PULLDOWN", "KEEPER", "SLEW", "DRIVE", | ||||||||
"DELAY_OBF", "DELAY_IBF", "FF_IBF", "FF_OBF", "LVDS_BOOST", "LVDS_TERM" | ||||||||
] -%} | ||||||||
whitequark marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||
{%- for constraint in constraints if constraint in attrs -%} | ||||||||
| {{constraint}}={{attrs[constraint]}} | ||||||||
{%- endfor -%}; | ||||||||
{% endfor %} | ||||||||
""", | ||||||||
"{{name}}.sdc": r""" | ||||||||
# {{autogenerated}} | ||||||||
{% for net_signal, port_signal, frequency in platform.iter_clock_constraints() -%} | ||||||||
|
||||||||
{% if port_signal is not none -%} | ||||||||
create_clock -period {{1000000000/frequency}} [get_ports {{port_signal.name|tcl_quote}}] | ||||||||
{% endif %} | ||||||||
{% endfor %} | ||||||||
""", | ||||||||
} | ||||||||
|
||||||||
command_templates = [ | ||||||||
r""" | ||||||||
mkdir -p log; | ||||||||
mkdir -p net; | ||||||||
whitequark marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||
{{invoke_tool("yosys")}} | ||||||||
-ql log/synth.log -p 'read -sv {{name}}.v; synth_gatemate -top {{name}} -nomx8 -vlog net/{{name}}_synth.v' | ||||||||
|
||||||||
""", | ||||||||
r""" | ||||||||
{{invoke_tool("p_r")}} | ||||||||
-v | ||||||||
tarik-hamedovic marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||
-i net/{{name}}_synth.v | ||||||||
-o {{name}} | ||||||||
-ccf {{name}}.ccf | ||||||||
-cCP > log/impl.log | ||||||||
whitequark marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
-cCP > log/impl.log | |
-cCP | |
> {{name}}.tim |
The .rpt
/.tim
extension is something we've been using for Yosys based platforms and isn't set in stone, but it's nice to have consistency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to
r"""
{{invoke_tool("p_r")}}
{{verbose("-v")}}
-i {{name}}_synth.v
-o {{name}}
-ccf {{name}}.ccf
-cCP
> {{name}}.tim
""",
whitequark marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
whitequark marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't look right--you aren't using osc_div
and osc_freq
anywhere in the instantiation and qlal4s3b_cell_macro
is a QuickLogic primitive. Do GateMate FPGAs have any internal oscillator at all, like RC oscillator or ring oscillator? If not then the create_missing_domain
function should only use an async reset synchronizer, or possibly just be absent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From what I have read on their documentation for the CCGM1A1 Chip, there are no oscillators(ring or RC) on the chip.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then you don't need any implementation of create_missing_domain
or default_clk_constraint
at all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed create_missing_domain
and default_clk_constraint
.
Uh oh!
There was an error while loading. Please reload this page.