<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"Tw Cen MT";
        panose-1:2 11 6 2 2 1 4 2 6 3;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.EmailStyle18
        {mso-style-type:personal;
        font-family:"Tw Cen MT",sans-serif;
        color:windowtext;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">Hi Jens,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Is there a real need to have the telescope driver twice in memory?<o:p></o:p></p>
<p class="MsoNormal">Would it be enough to implement the driver as “object oriented” in C?<o:p></o:p></p>
<p class="MsoNormal">Then you would just need to create a context struct during initialization based on the hartid with the correct interrupt assignment and base address of the memory mapped registers.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">At least that is a common pattern in the driver implementations of RTEMS.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Best regards,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">    Jan<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">PS: It is probably a good idea to remove the disclaimer in your email footer before posting to a public mailinglist.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b>From:</b> users <users-bounces@rtems.org> <b>On Behalf Of
</b>Schweikhardt, Jens (TSPCE6-TL5)<br>
<b>Sent:</b> Montag, 24. Oktober 2022 13:53<br>
<b>To:</b> 'users@rtems.org' <users@rtems.org><br>
<b>Subject:</b> Running two RTEMS instances on two RISC-V harts<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Tw Cen MT",sans-serif">hello, world\n<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Tw Cen MT",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Tw Cen MT",sans-serif">we’re currently in the design phase for a rocketchip RISC-V project with two harts.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Tw Cen MT",sans-serif">Think a common HW platform where each hart drives a separate telescope unit.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Tw Cen MT",sans-serif">The C code for each telescope is basically identical with the exception of memory mapped registers and interrupts.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Tw Cen MT",sans-serif">Our idea is to compile the C code twice and link with different linkerscripts, separating the images in RAM<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Tw Cen MT",sans-serif">via different MEMORY { RAM: ORIGIN = 0x######## } declarations. A bootloader loads the images<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Tw Cen MT",sans-serif">to different addresses and branches depending on mhartid, starting two separate RTEMS applications, each<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Tw Cen MT",sans-serif">of which runs 10 tasks. There’s no communication between the RTEMS instances.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Tw Cen MT",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Tw Cen MT",sans-serif">Are we attempting something crazy (too complex) and we should instead look into <your suggestion here>?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Tw Cen MT",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Tw Cen MT",sans-serif">If not, is there a simple way to compile an app twice for different RAM: ORIGIN values?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Tw Cen MT",sans-serif">I tried using a Linkerscript with -Wl,-T,Linkerscript with a different MEMORY but this draws a warning such as<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Tw Cen MT",sans-serif">warning: redeclaration of memory region `RAM'<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Tw Cen MT",sans-serif">and uses the value in the BSPs  linkcmds file. It looks like the last declaration wins and the linkcmds is<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Tw Cen MT",sans-serif">always read
<i>after</i> linker scripts specified by my -Wl command line option.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Tw Cen MT",sans-serif"><o:p> </o:p></span></p>
<table class="NormaleTabelle" border="0" cellspacing="0" cellpadding="0" width="360" style="width:270.0pt">
<tbody>
<tr>
<td colspan="3" style="padding:0cm 0cm 0cm 0cm">
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="font-size:14.0pt;font-family:"Tw Cen MT",sans-serif;color:#004070;mso-fareast-language:DE">Jens Schweikhardt<br>
</span><span style="font-size:10.0pt;font-family:"Tw Cen MT",sans-serif;color:#004070;mso-fareast-language:DE"><br>
TL4 LCT Software Development</span><span style="font-size:12.0pt;font-family:"Times New Roman",serif;mso-fareast-language:DE"><o:p></o:p></span></p>
</td>
</tr>
<tr>
<td style="padding:0cm 0cm 0cm 0cm">
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:10.0pt;font-family:"Tw Cen MT",sans-serif;color:#004070;mso-fareast-language:DE">Phone:<br>
<br>
Mail: </span><span style="font-size:12.0pt;font-family:"Times New Roman",serif;mso-fareast-language:DE"><o:p></o:p></span></p>
</td>
<td style="padding:0cm 0cm 0cm 0cm">
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Tw Cen MT",sans-serif;mso-fareast-language:DE"><a href="tel:+4971919302849"><span style="color:#004070">+49 7191 930-2849</span></a><br>
<br>
<a href="mailto:Jens.Schweikhardt@tesat.de"><span style="color:#004070">Jens.Schweikhardt@tesat.de</span></a></span><span style="font-size:12.0pt;font-family:"Times New Roman",serif;mso-fareast-language:DE"><o:p></o:p></span></p>
</td>
<td style="padding:0cm 0cm 0cm 0cm">
<p class="MsoNormal" align="right" style="text-align:right"><a href="https://www.tesat.de/" target="_blank"><span style="font-size:12.0pt;font-family:"Times New Roman",serif;color:blue;mso-fareast-language:DE;text-decoration:none"><img border="0" width="150" height="50" style="width:1.5625in;height:.5208in" id="Bild_x0020_1" src="cid:image001.gif@01D8E7B1.1870E870" alt="logo"></span></a><span style="font-size:12.0pt;font-family:"Times New Roman",serif;mso-fareast-language:DE"><o:p></o:p></span></p>
</td>
</tr>
<tr>
<td colspan="3" style="padding:0cm 0cm 0cm 0cm">
<div class="MsoNormal" align="center" style="text-align:center"><span style="font-size:12.0pt;font-family:"Times New Roman",serif;mso-fareast-language:DE">
<hr size="1" width="100%" noshade="" style="color:#004070" align="center">
</span></div>
</td>
</tr>
<tr>
<td colspan="2" style="padding:0cm 0cm 0cm 0cm">
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Tw Cen MT",sans-serif;color:#004070;mso-fareast-language:DE">Tesat-Spacecom GmbH & Co. KG<br>
Gerberstraße 49<br>
71522 Backnang</span><span style="font-size:12.0pt;font-family:"Times New Roman",serif;mso-fareast-language:DE"><o:p></o:p></span></p>
</td>
<td style="padding:0cm 0cm 0cm 0cm">
<p class="MsoNormal" align="right" style="text-align:right"><a href="https://www.facebook.com/TesatSpacecom/" target="_blank"><span style="font-size:12.0pt;font-family:"Times New Roman",serif;color:blue;mso-fareast-language:DE;text-decoration:none"><img border="0" width="40" height="35" style="width:.4166in;height:.3645in" id="Bild_x0020_3" src="cid:image002.gif@01D8E7B1.1870E870" alt="fb"></span></a><a href="https://www.linkedin.com/company/tesat" target="_blank"><span style="font-size:12.0pt;font-family:"Times New Roman",serif;color:blue;mso-fareast-language:DE;text-decoration:none"><img border="0" width="40" height="35" style="width:.4166in;height:.3645in" id="Bild_x0020_4" src="cid:image003.gif@01D8E7B1.1870E870" alt="li"></span></a><a href="https://www.twitter.com/TesatSpacecom" target="_blank"><span style="font-size:12.0pt;font-family:"Times New Roman",serif;color:blue;mso-fareast-language:DE;text-decoration:none"><img border="0" width="35" height="35" style="width:.3645in;height:.3645in" id="Bild_x0020_5" src="cid:image004.gif@01D8E7B1.1870E870" alt="tw"></span></a><span style="font-size:12.0pt;font-family:"Times New Roman",serif;mso-fareast-language:DE"><o:p></o:p></span></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal"><span lang="DE" style="font-size:12.0pt;font-family:"Times New Roman",serif;mso-fareast-language:DE"><o:p> </o:p></span></p>
<table class="NormaleTabelle" border="0" cellspacing="0" cellpadding="0" width="600" style="width:450.0pt">
<tbody>
<tr>
<td style="padding:0cm 0cm 0cm 0cm">
<p class="MsoNormal"><span style="font-size:8.0pt;font-family:"Tw Cen MT",sans-serif;color:#004070;mso-fareast-language:DE">This electronic message may contain highly confidential or privileged information from Tesat-Spacecom GmbH & Co. KG. Any of the information
 is only intended for the recipient and the use by any other party is not authorized. If you are not the intended recipient, be aware, that any disclosure, copying, distribution or use of the contents of this message is prohibited. If you have received this
 message by error please notify us immediately by telephone (+49 7191 930-2849) or by e-mail (Jens.Schweikhardt@tesat.de). Thank you.</span><span style="font-size:12.0pt;font-family:"Times New Roman",serif;mso-fareast-language:DE">
<o:p></o:p></span></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal"><span lang="DE" style="mso-fareast-language:DE"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="DE"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="DE"><o:p> </o:p></span></p>
<div class="MsoNormal" align="center" style="text-align:center"><span lang="DE">
<hr size="2" width="100%" align="center">
</span></div>
<p class="MsoNormal"><span lang="DE" style="font-size:7.5pt;font-family:"Arial",sans-serif;color:gray"><br>
Tesat-Spacecom GmbH & Co. KG<br>
Sitz: Backnang; Registergericht: Amtsgericht Stuttgart HRA 270977<br>
Persoenlich haftender Gesellschafter: Tesat-Spacecom Geschaeftsfuehrungs GmbH;<br>
Sitz: Backnang; Registergericht: Amtsgericht Stuttgart HRB 271658;<br>
Geschaeftsfuehrung: Thomas Reinartz, Kerstin Basche, Ralph Schmid<br>
</span><span lang="DE"><br>
<span style="border:solid windowtext 1.0pt;padding:0cm"><img border="0" width="680" height="194" style="width:7.0833in;height:2.0208in" id="_x0000_i1031" src="cid:image005.jpg@01D8E7B1.1870E870" alt="Image removed by sender. banner"></span><o:p></o:p></span></p>
</div>
</body>
</html>