yuri-panchul / systemverilog-homework

SystemVerilog language-oriented exercises
MIT License
48 stars 69 forks source link

fix path to icarus verilog/gtkwave #6

Closed EDAMC closed 1 year ago

EDAMC commented 1 year ago
  1. Не совсем понятно зачем опрашивать есть ли переменная с путем к icarus в .bat файле, если позже всё равно пишется полный путь к исполняемым файлам:
    
    @echo off

where iverilog > nul 2>&1

if errorlevel 1 ( echo ERROR: iverilog.exe is not in the path or cannot be run. echo See README.md file in the package directory for the instructions on how to install Icarus Verilog. pause exit /b 1 )

echo ALL PROBLEMS > log.txt

for %%f in (*.sv) do ( C:\iverilog\bin\iverilog -g2005-sv %%f >> log.txt 2>&1 C:\iverilog\bin\vvp a.out >> log.txt 2>&1 rem C:\iverilog\gtkwave\bin\gtkwave dump.vcd

2) У некоторых людей возникла такая ситуация, что они установили icarus на D:/, имеют путь в переменных среды и скрипт её нашёл, но заработал только .sh файл из git bash, т.к там идёт обращение к переменным напрямую, а .bat отвалился потому что icarus лежит не на C:/

!/bin/sh

if ! command -v iverilog >/dev/null 2>&1 then echo "ERROR: Icarus Verilog (iverilog) is not in the path" \ "or cannot be run." \ "See README.md file in the package directory for the instructions" \ "how to install Icarus." \ 2>&1

echo "Press enter"
read enter
exit 1

fi

rm -rf log.txt

for f in *.sv do iverilog -g2005-sv $f >> log.txt 2>&1 \ && vvp a.out >> log.txt 2>&1

# gtkwave dump.vcd

done


Я добавил описание в .md файл, чтобы люди не забывали при установке icarus добавлять пути в PATH, благо это можно сделать автоматически при установке. Так же дал ссылку на то как это сделать, если забыли про установке и заменил строчки в .bat.

Если ошибаюсь, поправьте меня пожалуйста.
Спасибо!
yuri-panchul commented 1 year ago

Я внес следующие изменения. Вы можете их проверить?

@echo off

echo ALL PROBLEMS > log.txt

where iverilog > nul 2>&1

if errorlevel 1 ( if exist C:\iverilog\bin\iverilog.exe ( for %%f in (.sv) do ( C:\iverilog\bin\iverilog -g2005-sv %%f >> log.txt 2>&1 C:\iverilog\bin\vvp a.out >> log.txt 2>&1 rem C:\iverilog\gtkwave\bin\gtkwave dump.vcd ) ) else ( echo ERROR: iverilog.exe is not in the path, is not in the default location C:\iverilog\bin or cannot be run. echo See README.md file in the package directory for the instructions on how to install Icarus Verilog. pause exit /b 1 ) ) else ( for %%f in (.sv) do ( iverilog -g2005-sv %%f >> log.txt 2>&1 vvp a.out >> log.txt 2>&1 rem gtkwave dump.vcd ) )

del /q a.out

findstr PASS log.txt findstr FAIL log.txt findstr error log.txt

On 2023-10-15 08:21, semyon Moskolenko wrote:

  • Не совсем понятно зачем опрашивать есть ли пути к icarus в .bat файле, если позже всё равно пишется полный путь к исполняемым файлам:

@echo off

where iverilog > nul 2>&1

if errorlevel 1 ( echo ERROR: iverilog.exe is not in the path or cannot be run. echo See README.md file in the package directory for the instructions on how to install Icarus Verilog. pause exit /b 1 )

echo ALL PROBLEMS > log.txt

for %%f in (*.sv) do ( C:\iverilog\bin\iverilog -g2005-sv %%f >> log.txt 2>&1 C:\iverilog\bin\vvp a.out >> log.txt 2>&1 rem C:\iverilog\gtkwave\bin\gtkwave dump.vcd

  • У некоторых людей возникла такая ситуация, что они установили icarus на D:/, имеют путь в переменных среды и скрипт её нашёл, но заработал только .sh файл из git bash, т.к там идёт обращение к переменным напрямую, а .bat отвалился потому что icarus лежит не на C:/

!/bin/sh

if ! command -v iverilog >/dev/null 2>&1 then echo "ERROR: Icarus Verilog (iverilog) is not in the path"
\ "or cannot be run." \ "See README.md file in the package directory for the instructions" \ "how to install Icarus." \ 2>&1

echo "Press enter" read enter exit 1 fi

rm -rf log.txt

for f in *.sv do iverilog -g2005-sv $f >> log.txt 2>&1 \ && vvp a.out >> log.txt 2>&1

gtkwave dump.vcd

done

Я добавил описание в .md файл, чтобы люди не забывали при установке icarus добавлять пути в PATH, благо это можно сделать автоматически при установке. Так же дал ссылку на то как это сделать, если забыли про установке и заменил строчки в .bat.

Если ошибаюсь, поправьте меня пожалуйста. Спасибо!

YOU CAN VIEW, COMMENT ON, OR MERGE THIS PULL REQUEST ONLINE AT:

https://github.com/yuri-panchul/systemverilog-homework/pull/6

COMMIT SUMMARY

  • 761a207 [1] fix path to icarus verilog/gtkwave

FILE CHANGES

(3 files [2])

  • M 01_combinational_logic/run_all_using_iverilog_under_windows.bat [3] (7)
  • M 02_sequential_basics/run_all_using_iverilog_under_windows.bat [4] (6)
  • M README.md [5] (3)

PATCH LINKS:

-- Reply to this email directly, view it on GitHub [6], or unsubscribe [7]. You are receiving this because you are subscribed to this thread.Message ID: @.***>

Links:

[1] https://github.com/yuri-panchul/systemverilog-homework/pull/6/commits/761a207f221641cd299d744a5d316ee89a837a40 [2] https://github.com/yuri-panchul/systemverilog-homework/pull/6/files [3] https://github.com/yuri-panchul/systemverilog-homework/pull/6/files#diff-9480b6621ddb70657510679c9ae80f67e694ece68b7f6a16d7ef528997fef6f3 [4] https://github.com/yuri-panchul/systemverilog-homework/pull/6/files#diff-86a97311b1943ba6336f9dcedaca5ace4c54c0bdc959306dba64285d9caf0267 [5] https://github.com/yuri-panchul/systemverilog-homework/pull/6/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5 [6] https://github.com/yuri-panchul/systemverilog-homework/pull/6 [7] https://github.com/notifications/unsubscribe-auth/AC6OFWU4WGGVAXS7ACJXM2TX7PWOFAVCNFSM6AAAAAA6BBMKPWVHI2DSMVQWIX3LMV43ASLTON2WKOZRHE2DGOJQG44TKNA --=_74e32fd6603b6521966eaf322b5cc843 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=UTF-8

=D0=AF =D0=B2=D0=BD=D0=B5=D1=81 =D1=81=D0=BB=D0=B5=D0=B4=D1=83=D1=8E=D1= =89=D0=B8=D0=B5 =D0=B8=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD=D0=B8=D1=8F. =D0= =92=D1=8B =D0=BC=D0=BE=D0=B6=D0=B5=D1=82=D0=B5 =D0=B8=D1=85 =D0=BF=D1=80=D0= =BE=D0=B2=D0=B5=D1=80=D0=B8=D1=82=D1=8C?


***@***.*** off

echo ALL PROBLEMS > log.txt

where iverilog > nul 2>&1

if errorlevel 1 (
    if exist C:\iverilog\bin\iverilog.e= xe (
        for %%f in (*.sv) do (
  &n= bsp;         C:\iverilog\bin\iverilog -g2005-sv %%f >= ;> log.txt 2>&1
            C:= \iverilog\bin\vvp a.out >> log.txt 2>&1
    &nb= sp;       rem C:\iverilog\gtkwave\bin\gtkwave dump.vcd
=         )
    ) else (
   = ;     echo ERROR: iverilog.exe is not in the path, is not in the = default location C:\iverilog\bin or cannot be run.
     = ;   echo See README.md file in the package directory for the instructi= ons on how to install Icarus Verilog.
        paus= e
        exit /b 1
    )
) el= se (
    for %%f in (*.sv) do (
      &n= bsp; iverilog -g2005-sv %%f >> log.txt 2>&1
   =     vvp a.out >> log.txt 2>&1
    &n= bsp;   rem gtkwave dump.vcd
    )
)

del /q a.out

findstr PASS  log.txt
findstr FAIL  log.txt
findstr = error log.txt



On 2023-10-15 08:21, semyon Moskolenko wrote:

  1. =D0=9D=D0=B5 =D1=81=D0=BE=D0=B2=D1=81=D0=B5=D0=BC =D0=BF=D0=BE=D0=BD=D1= =8F=D1=82=D0=BD=D0=BE =D0=B7=D0=B0=D1=87=D0=B5=D0=BC =D0=BE=D0=BF=D1=80=D0= =B0=D1=88=D0=B8=D0=B2=D0=B0=D1=82=D1=8C =D0=B5=D1=81=D1=82=D1=8C =D0=BB=D0= =B8 =D0=BF=D1=83=D1=82=D0=B8 =D0=BA icarus =D0=B2 .bat =D1=84=D0=B0=D0=B9= =D0=BB=D0=B5, =D0=B5=D1=81=D0=BB=D0=B8 =D0=BF=D0=BE=D0=B7=D0=B6=D0=B5 =D0= =B2=D1=81=D1=91 =D1=80=D0=B0=D0=B2=D0=BD=D0=BE =D0=BF=D0=B8=D1=88=D0=B5=D1= =82=D1=81=D1=8F =D0=BF=D0=BE=D0=BB=D0=BD=D1=8B=D0=B9 =D0=BF=D1=83=D1=82=D1= =8C =D0=BA =D0=B8=D1=81=D0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B0 .bat =D0=BE=D1=82=D0=B2=D0=B0=D0=BB=D0=B8=D0=BB=D1= =81=D1=8F =D0=BF=D0=BE=D1=82=D0=BE=D0=BC=D1=83 =D1=87=D1=82=D0=BE icarus = =D0=BB=D0=B5=D0=B6=D0=B8=D1=82 =D0=BD=D0=B5 =D0=BD=D0=B0 C:/
#!/bin/sh

if ! command -v iverilog >/dev/null 2>&1
then
    echo "ERROR: Icarus Verilog (iverilog) is not in the path"             =
  \
         "or cannot be run."                                               =
  \
         "See README.md file in the package directory for the instructions"=
  \
         "how to install Icarus."                                          =
  \
          2>&1

    echo "Press enter"
    read enter
    exit 1
fi

rm -rf log.txt

for f in *.sv
do
       iverilog -g2005-sv $f >> log.txt 2>&1  \
    && vvp a.out             >> log.txt 2>&1

    # gtkwave dump.vcd
done

=D0=AF =D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB =D0=BE=D0= =BF=D0=B8=D1=81=D0=B0=D0=BD=D0=B8=D0=B5 =D0=B2 .md =D1=84=D0=B0=D0=B9=D0=BB= , =D1=87=D1=82=D0=BE=D0=B1=D1=8B =D0=BB=D1=8E=D0=B4=D0=B8 =D0=BD=D0=B5 =D0= =B7=D0=B0=D0=B1=D1=8B=D0=B2=D0=B0=D0=BB=D0=B8 =D0=BF=D1=80=D0=B8 =D1=83=D1= =81=D1=82=D0=B0=D0=BD=D0=BE=D0=B2=D0=BA=D0=B5 icarus =D0=B4=D0=BE=D0=B1=D0= =B0=D0=B2=D0=BB=D1=8F=D1=82=D1=8C =D0=BF=D1=83=D1=82=D0=B8 =D0=B2 PATH, =D0= =B1=D0=BB=D0=B0=D0=B3=D0=BE =D1=8D=D1=82=D0=BE =D0=BC=D0=BE=D0=B6=D0=BD=D0= =BE =D1=81=D0=B4=D0=B5=D0=BB=D0=B0=D1=82=D1=8C =D0=B0=D0=B2=D1=82=D0=BE=D0= =BC=D0=B0=D1=82=D0=B8=D1=87=D0=B5=D1=81=D0=BA=D0=B8 =D0=BF=D1=80=D0=B8 =D1= =83=D1=81=D1=82=D0=B0=D0=BD=D0=BE=D0=B2=D0=BA=D0=B5. =D0=A2=D0=B0=D0=BA =D0= =B6=D0=B5 =D0=B4=D0=B0=D0=BB =D1=81=D1=81=D1=8B=D0=BB=D0=BA=D1=83 =D0=BD=D0= =B0 =D1=82=D0=BE =D0=BA=D0=B0=D0=BA =D1=8D=D1=82=D0=BE =D1=81=D0=B4=D0=B5= =D0=BB=D0=B0=D1=82=D1=8C, =D0=B5=D1=81=D0=BB=D0=B8 =D0=B7=D0=B0=D0=B1=D1=8B= =D0=BB=D0=B8 =D0=BF=D1=80=D0=BE =D1=83=D1=81=D1=82=D0=B0=D0=BD=D0=BE=D0=B2= =D0=BA=D0=B5 =D0=B8 =D0=B7=D0=B0=D0=BC=D0=B5=D0=BD=D0=B8=D0=BB =D1=81=D1=82= =D1=80=D0=BE=D1=87=D0=BA=D0=B8 =D0=B2 .bat.

=D0=95=D1=81=D0=BB=D0=B8 =D0=BE=D1=88=D0=B8=D0=B1=D0=B0=D1= =8E=D1=81=D1=8C, =D0=BF=D0=BE=D0=BF=D1=80=D0=B0=D0=B2=D1=8C=D1=82=D0=B5 =D0= =BC=D0=B5=D0=BD=D1=8F =D0=BF=D0=BE=D0=B6=D0=B0=D0=BB=D1=83=D0=B9=D1=81=D1= =82=D0=B0.
=D0=A1=D0=BF=D0=B0=D1=81=D0=B8=D0=B1=D0=BE!


You can view, comment on, or merge this pull request online at:

  https://github.= com/yuri-panchul/systemverilog-homework/pull/6

Commit Summary

  • 761a207 fix path to icar= us verilog/gtkwave

File Changes

(3 files)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you= are subscribed to this thread.Message ID: <yuri-panchul/systemver= ilog-homework/pull/6@github.<= span>com>


--=_74e32fd6603b6521966eaf322b5cc843--

EDAMC commented 1 year ago

У меня всё работает, спасибо