Skip to content

Commit

Permalink
[ci] refactor OM tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sequencer committed Jul 30, 2024
1 parent 1311c4a commit b2045ae
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 30 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,24 @@ jobs:
if ! nix build ".#t1.${cfg}.subsystem.rtl" -L; then
failed_rtl_configs+=("${cfg}.subsystem")
fi
if ! nix run ".#ci-helper" -- runOMTests --config ${cfg}; then
failed_om+=("${cfg}")
fi
done
if [ -n "${failed_rtl_configs[*]}" ]; then
echo -e "## Failed RTL\n" >> "$GITHUB_STEP_SUMMARY"
for cfg in "${failed_rtl_configs[@]}"; do
echo "* ${cfg}" >> $GITHUB_STEP_SUMMARY
done
echo -e "## Failed RTL\n" >> "$GITHUB_STEP_SUMMARY"
for cfg in "${failed_om[@]}"; do
echo "* ${cfg}" >> $GITHUB_STEP_SUMMARY
done
printf "\n" >> $GITHUB_STEP_SUMMARY
fi
- name: "Run OM tests"
run: |
nix run ".#ci-helper" -- runOMTests --jobs "${{ matrix.jobs }}"
physical-design-report:
name: "Request physical design report"
Expand Down Expand Up @@ -164,9 +174,6 @@ jobs:
- name: "Run testcases"
run: |
nix run ".#ci-helper" -- runTests --jobs "${{ matrix.jobs }}"
- name: "Run OM tests"
run: |
nix run ".#ci-helper" -- runOMTests --jobs "${{ matrix.jobs }}"
report:
name: "Report CI result"
Expand Down
52 changes: 25 additions & 27 deletions script/ci/src/Main.scala
Original file line number Diff line number Diff line change
Expand Up @@ -200,35 +200,33 @@ object Main:

@main
def runOMTests(
jobs: String
config: String
): Unit =
val configs = jobs.split(";").map(_.split(",")(0))
configs.distinct.foreach: config =>
Seq("omreader", "emu-omreader").foreach: target =>
val command = Seq(
"nix",
"run",
s".#t1.$config.ip.$target",
"--",
"run",
"--dump-methods"
)
println("\n")
Logger.info(
s"Running OM test with command $BOLD'${command.mkString(" ")}'$RESET"
)
val outputs = os.proc(command).call().out.trim()
Logger.trace(s"Outputs:\n${outputs}")
Seq("omreader", "verilator-emu-omreader", "vcs-emu-omreader").foreach: target =>
val command = Seq(
"nix",
"run",
s".#t1.$config.ip.$target",
"--",
"run",
"--dump-methods"
)
println("\n")
Logger.info(
s"Running OM test with command $BOLD'${command.mkString(" ")}'$RESET"
)
val outputs = os.proc(command).call().out.trim()
Logger.trace(s"Outputs:\n${outputs}")

Seq("vlen =", "dlen =").foreach: keyword =>
if outputs.contains(keyword) then
Logger.info(
s"Keyword $BOLD'$keyword'$RESET found - ${GREEN}Pass!$RESET"
)
else
Logger.fatal(
s"Keyword $BOLD'$keyword'$RESET not found - ${RED}Fail!$RESET"
)
Seq("vlen =", "dlen =").foreach: keyword =>
if outputs.contains(keyword) then
Logger.info(
s"Keyword $BOLD'$keyword'$RESET found - ${GREEN}Pass!$RESET"
)
else
Logger.fatal(
s"Keyword $BOLD'$keyword'$RESET not found - ${RED}Fail!$RESET"
)
end runOMTests

// PostCI do the below four things:
Expand Down

0 comments on commit b2045ae

Please sign in to comment.