| Copyright | (C) 2022 Google Inc. |
|---|---|
| License | BSD2 (see the file LICENSE) |
| Maintainer | QBayLogic B.V. <devops@qbaylogic.com> |
| Safe Haskell | None |
| Language | Haskell2010 |
Clash.Backend.Verilog.Time
Description
Utilities and definitions to deal with Verilog's time unit. These definitions
are here mostly to deal with varying `timescale defintions, see:
Documentation
Verilog time units
Instances
Verilog time period. A combination of a length and a unit.
Instances
| NFData Period Source # | |||||
Defined in Clash.Backend.Verilog.Time | |||||
| Generic Period Source # | |||||
Defined in Clash.Backend.Verilog.Time Associated Types
| |||||
| Show Period Source # | |||||
| Eq Period Source # | |||||
| Hashable Period Source # | |||||
Defined in Clash.Backend.Verilog.Time | |||||
| type Rep Period Source # | |||||
Defined in Clash.Backend.Verilog.Time type Rep Period = D1 ('MetaData "Period" "Clash.Backend.Verilog.Time" "clash-lib-1.8.4-Avs1lkPVzQY2EJC6aQfI6Y" 'False) (C1 ('MetaCons "Period" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Unit))) | |||||
Verilog timescale. Influences simulation precision.
Constructors
| Scale | |
Instances
| NFData Scale Source # | |||||
Defined in Clash.Backend.Verilog.Time | |||||
| Generic Scale Source # | |||||
Defined in Clash.Backend.Verilog.Time Associated Types
| |||||
| Show Scale Source # | |||||
| Eq Scale Source # | |||||
| Hashable Scale Source # | |||||
Defined in Clash.Backend.Verilog.Time | |||||
| type Rep Scale Source # | |||||
Defined in Clash.Backend.Verilog.Time type Rep Scale = D1 ('MetaData "Scale" "Clash.Backend.Verilog.Time" "clash-lib-1.8.4-Avs1lkPVzQY2EJC6aQfI6Y" 'False) (C1 ('MetaCons "Scale" 'PrefixI 'True) (S1 ('MetaSel ('Just "step") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Period) :*: S1 ('MetaSel ('Just "precision") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Period))) | |||||
scaleToString :: Scale -> String Source #
Pretty print Scale to Verilog `timescale
>>>scaleToString (Scale (Period 100 Ps) (Period 10 Fs))"`timescale 100ps/10fs"
periodToString :: Period -> String Source #
Convert Unit to Verilog time unit
>>>periodToString (Period 100 Fs)"100fs"
parseUnit :: String -> Maybe Unit Source #
Parse string representing a Verilog time unit to Unit.
>>>parseUnit "ms"Just Ms>>>parseUnit "xs"Nothing
parsePeriod :: String -> Maybe Period Source #
Parse a Verilog
>>>parsePeriod "100ms"Just (Period 100 Ms)>>>parsePeriod "100xs"Nothing>>>parsePeriod "100"Nothing>>>parsePeriod "ms"Nothing