Skip to content
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

Fixed error caused by change to the parent class of Icarus_g2005. #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 15 additions & 12 deletions amaranth_cocotb/amaranth_cocotb.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,24 @@
import os
import shutil
import inspect

import re

class Icarus_g2005(Icarus):
def compile_command(self):

cmd_compile = (
["iverilog", "-o", self.sim_file, "-D", "COCOTB_SIM=1", "-s",
self.toplevel, "-g2005"]
+ self.get_define_commands(self.defines)
+ self.get_include_commands(self.includes)
+ self.compile_args
+ self.verilog_sources
)

return cmd_compile
def set_verilog_version_to(new_ver, old_cmds):
new_cmds = []
for each_cmd in old_cmds:
version_string_match = re.search("-g20..", each_cmd) # e.g. matches -g2012
if version_string_match == None:
new_cmds.append(each_cmd)
else:
new_cmds.append(each_cmd.replace(version_string_match.group(0), "-g2005"))
return new_cmds

old_cmds = super().compile_command()
new_ver = "-g2005"
new_cmds = set_verilog_version_to(new_ver, old_cmds)
return new_cmds


compile_args_waveforms = ['-s', 'cocotb_waveform_module']
Expand Down