package SVA; import List::*; //======== /* MISSING: mkSeqDelayUnbound mkSeqDelayConst mkSeqDelayRange */ // SVA functions function a valueFunctionSVA (b x, function a cf(b y, b z)) provisos (Bits#(b,sb)); let c0 = clockOf(x); let c = (c0!=noClock) ? c0 : error("arguments of SVA value functions cannot be clocked by noClock"); let r = noReset; let oldVal = primBuildModule(Prelude::primGetName(valueFunctionSVAint), c, r, module#(b); Reg#(b) oldValReg <- mkRegU; rule upd; oldValReg <= x; endrule return oldValReg; endmodule); return (cf(x, oldVal)); endfunction function b \$sampled (b x) provisos (Bits#(b,sb)); function old(x1,x2) = (x2); return (valueFunctionSVA(x, old)); endfunction function Bool \$rose (b x) provisos (Bits#(b,sb)); function gt(x1,x2) = (x1>x2); return (valueFunctionSVA(pack(x)[0], gt)); endfunction function Bool \$fell (b x) provisos (Bits#(b,sb)); function lt(x1,x2) = (x1hi) begin let str = "SVA: the lower bound ("; str = strConcat(str, integerToString(lo)); str = strConcat(str, ") of a sequence repetition range must not exceed the higher ("); str = strConcat(str, integerToString(hi)); str = strConcat(str, ")"); error(str); end else begin let m0 = mkSeqRepConst(m,lo); if (lohi) begin let str = "SVA: the lower bound ("; str = strConcat(str, integerToString(lo)); str = strConcat(str, ") of a delay range must not exceed the higher ("); str = strConcat(str, integerToString(hi)); str = strConcat(str, ")"); error(str); end else begin let m0 = mkSeqDelayConst(m,lo); if (lo