Verilog分配在LHS中产生'x',而RHS具有有效值

时间:2016-01-08 11:58:26

标签: encryption verilog

我已经坚持这个问题两天了,我无法解决它。 在这个verilog加密代码中,我在这一行中有一个分配:sumOut = out,当我尝试使用ModelSim调试它时,网络out具有有效值,但sumOut保持未定义{{ 1}}。 这是代码:

x

2 个答案:

答案 0 :(得分:0)

只是想指出在你的重置语句中,sumOut = 0已被注释掉,所以它没有重置寄存器。另一个if else可能最终工作,因为else默认执行了。由于你只有其他人在上面的代码中没有别的东西,所以不必关心。

答案 1 :(得分:0)

我通过进行以下更改解决了我的问题。似乎直到下一个时钟触发之后才进行分配。

REM this is using routines from: http://www.robvanderwoude.com/datetimentmath.php

:: Strip the day of the week from the current date
FOR %%A IN (%Date%) DO SET Today=%%A
:: Parse the date, prefix day and month with an extra leading zero
FOR /F "tokens=1-3 delims=/-" %%A IN ("%Today%") DO (
    REM For European date format DD-MM-YYYY use SET Day=0%%A and SET Month=0%%B instead
    SET Day=0%%B
    SET Month=0%%A
    SET Year=%%C
)
:: Remove excess leading zeroes
SET Day=%Day:~-2%
SET Month=%Month:~-2%
:: Display the results
SET Day
SET Month
SET Year
:: Convert to Julian date
CALL :JDate %Year% %Month% %Day%
:: Display the result
SET /A sdate=JDate

REM BECAUSE WE ARE POTENTIALLY GOING INTO MULTIPLE KEYSTORES FOR JAVA'S KEYTOOL, WE CAN JUST BY-PASS THE PASSWORD
ECHO.|"%JAVA_HOME%\bin\keytool" -list -v -alias "company.com" -keystore "%JAVA_HOME%\jre\lib\security\cacerts" > results.txt

FOR /F "tokens=1-15 delims= " %%a IN ('TYPE results.txt ^| FIND "until:" ') DO (
if %%k EQU Jan set mn=01
if %%k EQU Feb set mn=02
if %%k EQU Mar set mn=03
if %%k EQU Apr set mn=04
if %%k EQU May set mn=05
if %%k EQU Jun set mn=06
if %%k EQU Jul set mn=07
if %%k EQU Aug set mn=08
if %%k EQU Sep set mn=09
if %%k EQU Oct set mn=10
if %%k EQU Nov set mn=11
if %%k EQU Dec set mn=12

CALL :Jdatea %%o %mn% %%l
SET /A edate=JDatea
)

Set /A=Result==%eDate%-%sDate%

REM if less than 30 days, send an alert
if %Result% LSS 30 blat -f "sender@company.com" -t "someuser@company.com" -server 1.2.3.4 -subject "certificate for %computername% is about to expire in less than 30 days!" -q


:JDate
:: Convert date to Julian
:: Arguments : YYYY MM DD
:: Returns   : Julian date
::
:: First strip leading zeroes
SET MM=%2
SET DD=%3
IF %MM:~0,1% EQU 0 SET MM=%MM:~1%
IF %DD:~0,1% EQU 0 SET DD=%DD:~1%
::
:: Algorithm based on Fliegel-Van Flandern
:: algorithm from the Astronomical Almanac,
:: provided by Doctor Fenton on the Math Forum
:: (http://mathforum.org/library/drmath/view/51907.html),
:: and converted to batch code by Ron Bakowski.
SET /A Month1 = ( %MM% - 14 ) / 12
SET /A Year1  = %1 + 4800
SET /A JDate  = 1461 * ( %Year1% + %Month1% ) / 4 + 367 * ( %MM% - 2 -12 * %Month1% ) / 12 - ( 3 * ( ( %Year1% + %Month1% + 100 ) / 100 ) ) / 4 + %DD% - 32075
SET Month1=
SET Year1=
GOTO:EOF


:JDatea
:: Convert date to Julian
:: Arguments : YYYY MM DD
:: Returns   : Julian date
::
:: First strip leading zeroes
SET MM=%2
SET DD=%3
IF %MM:~0,1% EQU 0 SET MM=%MM:~1%
IF %DD:~0,1% EQU 0 SET DD=%DD:~1%
::
:: Algorithm based on Fliegel-Van Flandern
:: algorithm from the Astronomical Almanac,
:: provided by Doctor Fenton on the Math Forum
:: (http://mathforum.org/library/drmath/view/51907.html),
:: and converted to batch code by Ron Bakowski.
SET /A Month1 = ( %MM% - 14 ) / 12
SET /A Year1  = %1 + 4800
SET /A JDate  = 1461 * ( %Year1% + %Month1% ) / 4 + 367 * ( %MM% - 2 -12 * %Month1% ) / 12 - ( 3 * ( ( %Year1% + %Month1% + 100 ) / 100 ) ) / 4 + %DD% - 32075
SET Month1=
SET Year1=
GOTO:EOF


PAUSE