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

Lack of support for fractional timescales #24

Closed
Lampus opened this issue Jun 22, 2021 · 3 comments
Closed

Lack of support for fractional timescales #24

Lampus opened this issue Jun 22, 2021 · 3 comments

Comments

@Lampus
Copy link

Lampus commented Jun 22, 2021

I have VCD file dumped from Cadence Simvision viewer with less than femtosecond timescale:

$comment
TOOL:   simvision(64)   19.03-s012
$end

$date
    Jun 22, 2021 11:14:06
$end

$timescale
    0.001fs
$end


$scope module tb_top $end

Parsing of this file is failed with next error:

Error: Magnitude of timescale must be one of 1, 10, or 100.
Current magnitude is: 0

Used workaround:

...
magnitude = Decimal(re.findall(r"\d+(\.\d+)?|$", timescale)[0])
                if magnitude not in [Decimal('0.001'), 1, 10, 100]:
...
@samimia-swks
Copy link

I see the same issue. @cirosantilli can you please apply this fix?

@samimia-swks
Copy link

@cirosantilli to clarify, you already removed the error, but the problem is that this regex
magnitude = Decimal(re.findall(r"\d+|$", timescale)[0])
fails to parse 0.001fs as 0.001. It results in magnitude = 0 instead.

What @Lampus suggested, i.e.
Decimal(re.findall(r"\d+(\.\d+)?|$", timescale)[0])
seems to work

@cirosantilli
Copy link
Owner

Fixed and released on v2.3.6, let me know if any issues remain with this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants