<div dir="ltr">Hi Chris,<br><br>> This file does not look like a script to me. I suggest removing _scripts from<br>the path<br><br>Sure, I will revise it<br><br>> What is this file and where did it come from? I see no attribution or sources to make this binary file?<br><br>It's leon3's prom image, the source I use to build the binary is from this repository <a href="https://github.com/antmicro/renode-rtems-leon3/blob/main/build-prom.sh" target="_blank">https://github.com/antmicro/renode-rtems-leon3/blob/main/build-prom.sh</a>. About the attribution, where should I add it?</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jul 31, 2023 at 8:49 AM Chris Johns <<a href="mailto:chrisj@rtems.org">chrisj@rtems.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 29/7/2023 12:08 pm, Muhammad Sulthan Mazaya wrote:<br>
> Add leon3 implementation for rtems-test using renode.<br>
> <br>
> ---<br>
> .../testing/bsps/kendrytek210-renode.ini | 38 ++++++++++<br>
> tester/rtems/testing/bsps/leon3-renode.ini | 37 ++++++++++<br>
> tester/rtems/testing/renode.cfg | 65 ++++++++++++++++++<br>
> .../testing/renode_scripts/kendrytek210.resc | 53 ++++++++++++++<br>
> .../testing/renode_scripts/leon3-prom.bin | Bin 0 -> 529 bytes<br>
> .../rtems/testing/renode_scripts/leon3.resc | 47 +++++++++++++<br>
> 6 files changed, 240 insertions(+)<br>
> create mode 100644 tester/rtems/testing/bsps/kendrytek210-renode.ini<br>
> create mode 100644 tester/rtems/testing/bsps/leon3-renode.ini<br>
> create mode 100644 tester/rtems/testing/renode.cfg<br>
> create mode 100644 tester/rtems/testing/renode_scripts/kendrytek210.resc<br>
> create mode 100755 tester/rtems/testing/renode_scripts/leon3-prom.bin<br>
<br>
This file does not look like a script to me. I suggest removing _scripts from<br>
the path, eg:<br>
<br>
tester/rtems/testing/renode/leon3-prom.bin<br>
<br>
What is this file and where did it come from? I see no attribution or sources to<br>
make this binary file?<br>
<br>
Chris<br>
<br>
> create mode 100644 tester/rtems/testing/renode_scripts/leon3.resc<br>
> <br>
> diff --git a/tester/rtems/testing/bsps/kendrytek210-renode.ini b/tester/rtems/testing/bsps/kendrytek210-renode.ini<br>
> new file mode 100644<br>
> index 0000000..95850c5<br>
> --- /dev/null<br>
> +++ b/tester/rtems/testing/bsps/kendrytek210-renode.ini<br>
> @@ -0,0 +1,38 @@<br>
> +#<br>
> +# RTEMS Tools Project (<a href="http://www.rtems.org/" rel="noreferrer" target="_blank">http://www.rtems.org/</a>)<br>
> +# Copyright 2010-2014 Chris Johns (<a href="mailto:chrisj@rtems.org" target="_blank">chrisj@rtems.org</a>)<br>
> +# All rights reserved.<br>
> +#<br>
> +# This file is part of the RTEMS Tools package in 'rtems-tools'.<br>
> +#<br>
> +# Redistribution and use in source and binary forms, with or without<br>
> +# modification, are permitted provided that the following conditions are met:<br>
> +#<br>
> +# 1. Redistributions of source code must retain the above copyright notice,<br>
> +# this list of conditions and the following disclaimer.<br>
> +#<br>
> +# 2. Redistributions in binary form must reproduce the above copyright notice,<br>
> +# this list of conditions and the following disclaimer in the documentation<br>
> +# and/or other materials provided with the distribution.<br>
> +#<br>
> +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"<br>
> +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE<br>
> +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE<br>
> +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE<br>
> +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR<br>
> +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF<br>
> +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS<br>
> +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN<br>
> +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)<br>
> +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE<br>
> +# POSSIBILITY OF SUCH DAMAGE.<br>
> +#<br>
> +<br>
> +#<br>
> +# The Kendrytek210 Renode BSP<br>
> +#<br>
> +[kendrytek210-renode]<br>
> +bsp = kendrytek210-renode<br>
> +arch = riscv<br>
> +tester = %{_rtscripts}/renode.cfg<br>
> +bsp_resc_script = %{_rtscripts}/renode_scripts/kendrytek210.resc<br>
> diff --git a/tester/rtems/testing/bsps/leon3-renode.ini b/tester/rtems/testing/bsps/leon3-renode.ini<br>
> new file mode 100644<br>
> index 0000000..af48043<br>
> --- /dev/null<br>
> +++ b/tester/rtems/testing/bsps/leon3-renode.ini<br>
> @@ -0,0 +1,37 @@<br>
> +#<br>
> +# RTEMS Tools Project (<a href="http://www.rtems.org/" rel="noreferrer" target="_blank">http://www.rtems.org/</a>)<br>
> +# Copyright 2010-2014 Chris Johns (<a href="mailto:chrisj@rtems.org" target="_blank">chrisj@rtems.org</a>)<br>
> +# All rights reserved.<br>
> +#<br>
> +# This file is part of the RTEMS Tools package in 'rtems-tools'.<br>
> +#<br>
> +# Redistribution and use in source and binary forms, with or without<br>
> +# modification, are permitted provided that the following conditions are met:<br>
> +# # 1. Redistributions of source code must retain the above copyright notice,<br>
> +# this list of conditions and the following disclaimer.<br>
> +#<br>
> +# 2. Redistributions in binary form must reproduce the above copyright notice,<br>
> +# this list of conditions and the following disclaimer in the documentation<br>
> +# and/or other materials provided with the distribution.<br>
> +#<br>
> +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"<br>
> +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE<br>
> +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE<br>
> +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE<br>
> +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR<br>
> +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF<br>
> +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS<br>
> +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN<br>
> +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)<br>
> +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE<br>
> +# POSSIBILITY OF SUCH DAMAGE.<br>
> +#<br>
> +<br>
> +#<br>
> +# The Leon3 Renode BSP<br>
> +#<br>
> +[leon3-renode]<br>
> +bsp = leon3-renode<br>
> +arch = sparc<br>
> +tester = %{_rtscripts}/renode.cfg<br>
> +bsp_resc_script = %{_rtscripts}/renode_scripts/leon3.resc<br>
> diff --git a/tester/rtems/testing/renode.cfg b/tester/rtems/testing/renode.cfg<br>
> new file mode 100644<br>
> index 0000000..a6b13ec<br>
> --- /dev/null<br>
> +++ b/tester/rtems/testing/renode.cfg<br>
> @@ -0,0 +1,65 @@<br>
> +#<br>
> +# RTEMS Tools Project (<a href="http://www.rtems.org/" rel="noreferrer" target="_blank">http://www.rtems.org/</a>)<br>
> +# Copyright 2010-2014 Chris Johns (<a href="mailto:chrisj@rtems.org" target="_blank">chrisj@rtems.org</a>)<br>
> +# All rights reserved.<br>
> +#<br>
> +# This file is part of the RTEMS Tools package in 'rtems-tools'.<br>
> +#<br>
> +# Redistribution and use in source and binary forms, with or without<br>
> +# modification, are permitted provided that the following conditions are met:<br>
> +#<br>
> +# 1. Redistributions of source code must retain the above copyright notice,<br>
> +# this list of conditions and the following disclaimer.<br>
> +#<br>
> +# 2. Redistributions in binary form must reproduce the above copyright notice,<br>
> +# this list of conditions and the following disclaimer in the documentation<br>
> +# and/or other materials provided with the distribution.<br>
> +#<br>
> +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"<br>
> +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE<br>
> +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE<br>
> +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE<br>
> +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR<br>
> +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF<br>
> +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS<br>
> +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN<br>
> +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)<br>
> +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE<br>
> +# POSSIBILITY OF SUCH DAMAGE.<br>
> +#<br>
> +<br>
> +#<br>
> +# Renode<br>
> +#<br>
> +# Use a renode command to run the executable in the renode simulator.<br>
> +#<br>
> +<br>
> +%include %{_configdir}/base.cfg<br>
> +%include %{_configdir}/checks.cfg<br>
> +<br>
> +#<br>
> +# Console.<br>
> +#<br>
> +%define console_telnet<br>
> +%include %{_configdir}/console.cfg<br>
> +<br>
> +#<br>
> +# RTEMS version<br>
> +#<br>
> +%include %{_rtdir}/rtems/version.cfg<br>
> +<br>
> +<br>
> +#<br>
> +# Renode executable<br>
> +#<br>
> +%define renode_cmd renode --hide-monitor<br>
> +%define binary_opts -e $bin?=@%{test_executable}<br>
> +%define start_opts -e "s @%{bsp_resc_script}"<br>
> +%define add_path -e "path add @%{_rttesting}/renode_scripts"<br>
> +%define trim_command sed 's/.*\[output\] //'<br>
> +<br>
> +<br>
> +#<br>
> +# Executable<br>
> +#<br>
> +%execute %{renode_cmd} %{binary_opts} %{add_path} %{start_opts} | %{trim_command}<br>
> diff --git a/tester/rtems/testing/renode_scripts/kendrytek210.resc b/tester/rtems/testing/renode_scripts/kendrytek210.resc<br>
> new file mode 100644<br>
> index 0000000..fe13aa8<br>
> --- /dev/null<br>
> +++ b/tester/rtems/testing/renode_scripts/kendrytek210.resc<br>
> @@ -0,0 +1,53 @@<br>
> +using sysbus<br>
> +using monitor<br>
> +<br>
> +mach create "K210"<br>
> +<br>
> +machine LoadPlatformDescription @platforms/cpus/kendryte_k210.repl<br>
> +<br>
> +path add @/<br>
> +<br>
> +showAnalyzer "uartAnalyzer" uart Antmicro.Renode.Analyzers.LoggingUartAnalyzer<br>
> +uartAnalyzer TimestampFormat None<br>
> +<br>
> +set report_repeating_line """<br>
> +from Antmicro.Renode.Logging import ConsoleBackend <br>
> +ConsoleBackend.Instance.ReportRepeatingLines = True<br>
> +"""<br>
> +<br>
> +set add_hook """<br>
> +def match(line):<br>
> + ok_to_kill_lines = [<br>
> + '*** TEST STATE: USER_INPUT',<br>
> + '*** TEST STATE: BENCHMARK',<br>
> + '*** END OF TEST ',<br>
> + '*** FATAL ***'<br>
> + ]<br>
> + return any(l in line for l in ok_to_kill_lines)<br>
> +<br>
> +def hook(line):<br>
> + monitor.Parse("q")<br>
> +<br>
> +Antmicro.Renode.Hooks.UartHooksExtensions.AddLineHook(monitor.Machine["sysbus.uart"], match, hook)<br>
> +"""<br>
> +<br>
> +python $add_hook<br>
> +<br>
> +python $report_repeating_line <br>
> +<br>
> +sysbus Tag <0x50440000 0x10000> "SYSCTL"<br>
> +sysbus Tag <0x50440018 0x4> "pll_lock" 0xFFFFFFFF<br>
> +sysbus Tag <0x5044000C 0x4> "pll1"<br>
> +sysbus Tag <0x50440008 0x4> "pll0"<br>
> +sysbus Tag <0x50440020 0x4> "clk_sel0"<br>
> +sysbus Tag <0x50440028 0x4> "clk_en_cent"<br>
> +sysbus Tag <0x5044002c 0x4> "clk_en_peri"<br>
> +<br>
> +# enable uart tx<br>
> +uart WriteDoubleWord 0x8 0x1<br>
> +<br>
> +macro reset<br>
> +"""<br>
> + sysbus LoadELF $bin <br>
> +"""<br>
> +runMacro $reset<br>
> diff --git a/tester/rtems/testing/renode_scripts/leon3-prom.bin b/tester/rtems/testing/renode_scripts/leon3-prom.bin<br>
> new file mode 100755<br>
> index 0000000000000000000000000000000000000000..a42628906b6915c589f6be96fe5de82a940c6529<br>
> GIT binary patch<br>
> literal 529<br>
> zcmYk&F-yZh6bJBsQma+O9uC$)FhikhM;GxB2R}yq7LJ!#(<mZEM2ZwSt%!*D2?}kc<br>
> z4h|h01RaFy;NT$Q;2>1uKedqte%#A@3Gco0o*blrF<-dG3t@Q`z^jr1PRRmTcO>iC<br>
> zTMbzff4Mk6N(p6;z9(^cO(Mvc#gPB)(jM)TrZYOH3%aB$x~3bd&;cFN5mo7!YIH(@<br>
> zHr8A-`tS_k3&-Z%*61Ed|M=Wmr=mNpLf5ht@^Nm00@2%SXIf~_w{S=I)TIY{q-T1e<br>
> z9=*~Vz0)Us(Kr3jXs;yR(V5jGPEMhaPGYtnJn{XMi)JARO?FmcCa(Kp$?ZU5yQrs!<br>
> zJ54GrZPv$AD}B~Ckj{rrNz}U?M<NX<pLe3P0rwm9@F8u{jQW9NtmRx3HF9;+C@8B|<br>
> S&~A#~dM!DadpO4bG4%^DAaPm%<br>
> <br>
> literal 0<br>
> HcmV?d00001<br>
> <br>
> diff --git a/tester/rtems/testing/renode_scripts/leon3.resc b/tester/rtems/testing/renode_scripts/leon3.resc<br>
> new file mode 100644<br>
> index 0000000..37f5f2b<br>
> --- /dev/null<br>
> +++ b/tester/rtems/testing/renode_scripts/leon3.resc<br>
> @@ -0,0 +1,47 @@<br>
> +using sysbus<br>
> +using monitor<br>
> +<br>
> +mach create "leon3"<br>
> +<br>
> +machine LoadPlatformDescription @platforms/boards/leon3.repl<br>
> +<br>
> +path add @/<br>
> +<br>
> +showAnalyzer "uartAnalyzer" uart Antmicro.Renode.Analyzers.LoggingUartAnalyzer<br>
> +uartAnalyzer TimestampFormat None<br>
> +<br>
> +set report_repeating_line """<br>
> +from Antmicro.Renode.Logging import ConsoleBackend <br>
> +ConsoleBackend.Instance.ReportRepeatingLines = True<br>
> +"""<br>
> +<br>
> +set add_hook """<br>
> +def my_match(line):<br>
> + ok_to_kill_lines = [<br>
> + '*** TEST STATE: USER_INPUT',<br>
> + '*** TEST STATE: BENCHMARK',<br>
> + '*** END OF TEST ',<br>
> + '*** FATAL ***'<br>
> + ]<br>
> + return any(l in line for l in ok_to_kill_lines)<br>
> +<br>
> +def my_hook(line):<br>
> + print line<br>
> + monitor.Parse("q")<br>
> +<br>
> +Antmicro.Renode.Hooks.UartHooksExtensions.AddLineHook(monitor.Machine["sysbus.uart"], my_match, my_hook)<br>
> +"""<br>
> +<br>
> +python $add_hook<br>
> +<br>
> +python $report_repeating_line <br>
> +<br>
> +macro reset<br>
> +"""<br>
> + sysbus LoadBinary @leon3-prom.bin 0x0<br>
> + sysbus LoadELF $bin<br>
> +<br>
> + cpu PC 0<br>
> +"""<br>
> +<br>
> +runMacro $reset<br>
_______________________________________________<br>
devel mailing list<br>
<a href="mailto:devel@rtems.org" target="_blank">devel@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/devel</a><br>
</blockquote></div>