BSC 與 SIC:
從 VEOS SIL 延伸到 HIL 測試
BSC(Bus Simulation Container)與 SIC(Simulink Implementation Container)是可跨平台重用的容器。同一組容器可先在 VEOS 上做 SIL 離線模擬,再重用於 ConfigurationDesk/SCALEXIO 的即時 HIL 測試,實現無縫延伸。
SIL(Software-in-the-Loop)與 HIL(Hardware-in-the-Loop)在 dSPACE 工具鏈中共用同一套「容器」資產。BSC 封裝匯流排通訊、SIC 封裝行為模型,兩者皆獨立於工具、可跨平台重用。本頁說明如何把在 VEOS 上完成的 SIL 驗證,延伸重用到 SCALEXIO/MicroAutoBox III/MicroLabBox II 的即時 HIL 測試。內容整理自 dSPACE 原廠手冊(RLS2024-B)。
1. SIL 與 HIL 的定位
SIL(VEOS)
於 PC 上以 C 程式碼模擬虛擬 ECU 與環境模型的離線模擬應用(OSA),無需即時硬體,適合早期、大量、自動化驗證。
HIL(ConfigurationDesk + SCALEXIO)
將設計實作為即時應用(Real-Time Application)下載到 SCALEXIO/MicroAutoBox III/MicroLabBox II,連接真實匯流排與 I/O,進行即時測試。
2. 核心概念:同一組容器跨平台重用
延伸的關鍵在於 BSC 與 SIC 是「通用交換格式」:
- BSCBus Manager 產生後,可匯入 VEOS(SIL)或作為 model implementation 加入 ConfigurationDesk(HIL)。匯流排通訊程式碼已包在 BSC 內,建置即時應用時不再重新產生。
- SIC行為模型容器,加入 ConfigurationDesk 或匯入 VEOS 皆不需 MATLAB;ConfigurationDesk 與 VEOS 支援以相同或前 7 個主要 Release 產生的 SIC。
- 共用變數描述Bus Manager 設定的通訊,其變數描述路徑在離線與即時應用中相同,可共用同一份 ControlDesk Layout。
3. 延伸路徑總覽
plant model 與行為模型介面維持不變,僅「匯流排存取指派」與「目標平台」隨階段調整(見第 6 節)。
4. SIL 階段:在 VEOS 部署
匯入容器
將 BSC(與 SIC)匯入 VEOS;BSC 的 bus access requests 以 communication controllers 呈現。
連接叢集與模型
communication controllers 連接到 communication clusters;port interface 的 signals 連到 plant model。
建置 OSA 並模擬
建置離線模擬應用(OSA),在 PC 上進行 SIL 模擬。
VEOS 中 data inports/outports/function ports 以 signals 呈現;runnable function ports 在 VEOS 不可用(匯入會出現警告)。此為 SIL 與 HIL 的介面差異之一。
5. HIL 階段:在 ConfigurationDesk 部署(重用同一容器)
加入容器
把相同的 BSC/SIC 當 model implementation 加入 ConfigurationDesk 應用;BSC 為每個 bus access request 建立 Configuration port,並建立 model port blocks。
指派真實硬體
Configuration ports 對應到 CAN / LIN / Ethernet Setup function blocks 並指派硬體資源;未對應則該通訊不會實作。可將同叢集的多個 Configuration ports 對應到同一 function block。
建置與下載
接入訊號鏈後建置即時應用並下載到硬體;因程式碼已在 BSC 內,建置更快。
PDU RX Interrupt:將 CAN function block 對應到 Configuration port 時,ConfigurationDesk 建立預定義非同步任務 CAN RX Task(含 I/O event 與 runnable function)。使用 Bus Manager 的 PDU RX Interrupt 特性時,此任務確保低延遲接收,預設優先權為最高(0),建議勿更改。
6. SIL → HIL:哪些不變、哪些改變
| 面向 | VEOS(SIL) | ConfigurationDesk(HIL) |
|---|---|---|
| BSC / SIC 容器 | 不變——同一檔案重用 | |
| plant / 行為模型介面 | 不變 | |
| 變數描述路徑 / ControlDesk Layout | 不變——可共用 | |
| 匯流排存取 | communication controllers → communication clusters(虛擬) | Configuration ports → CAN/LIN function blocks + 真實硬體資源 |
| 執行方式 | PC 離線模擬(OSA) | 即時硬體執行(RTA) |
| runnable function ports | 不可用 | 可用(Runnable Function blocks) |
| I/O | 全模擬 | 真實 I/O 通道 / 硬體 |
7. 平台與相容性需求
- SIC Target Architecture 決定 HIL 平台若含 SIC,其 target architecture 決定 BSC 可用平台:64-bit → SCALEXIO Linux 64-bit、MicroLabBox II、VEOS Linux 64-bit;32-bit → MicroAutoBox III、VEOS Windows/Linux。延伸到特定 HIL 硬體前,須以對應架構產生 SIC。
- BSC 版本相容ConfigurationDesk(2024-B)可使用以當前或前 7 個 Release 產生的 BSC。
- Shared objects建置時,BSC 提供、且符合已註冊平台的 shared objects 會被封存進即時應用;下載後於即時系統上供模擬存取。
- 預編譯加速建置可建立 precompiled BSC / SIC(亦可移除可讀原始碼以保護 IP),縮短 HIL 建置時間。
8. HIL 特有能力
真實匯流排與 I/O
Configuration ports 對應真實 CAN/LIN/Ethernet function blocks 與硬體資源,與真實 ECU 進行實體通訊。
Data Replay in a HIL Environment
ConfigurationDesk 支援於 HIL 環境進行資料重播(Data Replay)。
低延遲 RX 任務
PDU RX Interrupt 的預定義高優先權 CAN RX Task,確保即時低延遲接收。
下載與平台管理
以 Platform Manager 下載、啟動、停止、卸載單核/多核/多 PU 即時應用;下載前檢查 load description 相容性。
9. 從 SIL 遷移到 HIL 檢查清單
- SIC 以對應 HIL 硬體的 target architecture 產生(如 SCALEXIO → 64-bit)
- BSC 版本在 ConfigurationDesk 支援範圍內(當前或前 7 個 Release)
- BSC 的每個 Configuration port 已對應到 CAN/LIN function block 並指派硬體資源
- 未把 BSC 的 Configuration ports 對應到用於 bus configuration bus access 的 function blocks
- 使用 PDU RX Interrupt 時,保留 CAN RX Task 預設優先權(0)
- SIL 中使用的 runnable function 介面,於 HIL 以 Runnable Function blocks 正確接入
- 沿用同一份 ControlDesk Layout(變數描述路徑相同)
- 建置後以 Platform Manager 下載,並確認 load description 相容
延伸閱讀:Bus Manager 簡介、SIC 與 BSC 整合說明、TargetLink V-ECU 模擬解決方案。
原始文件出處(dSPACE RLS2024-B)
| 文件 / 章節 | 檔名 |
|---|---|
| ConfigurationDesk Real-Time Implementation Guide — Working with BSC/SIC Files、Data Replay in a HIL Environment | ConfigurationDeskImplementationGuide.pdf |
| Bus Manager Implementation Guide — Deploying BSC to VEOS / ConfigurationDesk | BusManagerImplementationGuide.pdf |
| Model Interface Package for Simulink — SIC Target Architecture | ModelInterfacePackageForSimulinkGuide.pdf |
| VEOS Manual · ConfigurationDesk Getting Started | VEOSManual.pdf · ConfigurationDeskGettingStarted.pdf |
路徑前綴:C:\Users\Public\Acolada\Cobrili\HelpSetStorage\dSPACEPDF\RLS2024-B\en\