From: Sebastien Bourdeauducq Date: Tue, 29 Sep 2015 05:11:40 +0000 (+0800) Subject: fhdl: typecheck ClockSignal and ResetSignal arguments X-Git-Tag: 24jan2021_ls180~2099^2~3^2~35 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b4c5ffc1bad1eed03be81bcf3420033c822419a8;p=litex.git fhdl: typecheck ClockSignal and ResetSignal arguments --- diff --git a/migen/fhdl/structure.py b/migen/fhdl/structure.py index ae378062..f4250266 100644 --- a/migen/fhdl/structure.py +++ b/migen/fhdl/structure.py @@ -379,6 +379,8 @@ class ClockSignal(_Value): """ def __init__(self, cd="sys"): _Value.__init__(self) + if not isinstance(cd, str): + raise TypeError("Argument of ClockSignal must be a string") self.cd = cd @@ -398,6 +400,8 @@ class ResetSignal(_Value): """ def __init__(self, cd="sys", allow_reset_less=False): _Value.__init__(self) + if not isinstance(cd, str): + raise TypeError("Argument of ResetSignal must be a string") self.cd = cd self.allow_reset_less = allow_reset_less