You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 1, 2021. It is now read-only.
The verilog spec is a bit vague on the details of file i/o system tasks. According to the grammar, they're statements. But according to their description, they can be invoked as statements or used as expressions which return values.
The way we've opted to handle this up until now is a bit ad-hoc. We've chosen to treat everything other than $fopen and$feof as statements. $feof we've chosen to treat as an expression, and $fopen we've hacked in a weird way where it can only appear on the right hand side of a declaration.
This was good for getting file i/o off the ground, but we can do better. The right thing to do is to add two different versions of tasks which can be used as statements or expressions to the grammar: one to represent a statement, and one to represent an expression.
If we do this well, we should be able to support the following code, which it should go without saying, we fall over and die on currently.
Overview
The verilog spec is a bit vague on the details of file i/o system tasks. According to the grammar, they're statements. But according to their description, they can be invoked as statements or used as expressions which return values.
The way we've opted to handle this up until now is a bit ad-hoc. We've chosen to treat everything other than
$fopen
and$feof
as statements.$feof
we've chosen to treat as an expression, and$fopen
we've hacked in a weird way where it can only appear on the right hand side of a declaration.This was good for getting file i/o off the ground, but we can do better. The right thing to do is to add two different versions of tasks which can be used as statements or expressions to the grammar: one to represent a statement, and one to represent an expression.
If we do this well, we should be able to support the following code, which it should go without saying, we fall over and die on currently.
Deliverables
The text was updated successfully, but these errors were encountered: