Designing a Shared Code System

You need to design your system in such a way that it can be built for multiple targets. Start by identifying all of the tasks that your system needs to accomplish. Then determine which tasks cannot be shared, by sorting them according to two criteria:

  • Which tasks can be omitted from the Riverbed model?
  • Which tasks will be highly implementation specific?

Tasks that fit these categories will need to be handled differently for each target, using techniques such as those described in Design Patterns for Shared Code.

Which Tasks Can Be Omitted from the Riverbed Model?

In general, you want to share as much code as possible. However, trying to model too much functionality can make your model run much slower or require extremely powerful computers to run. The same kinds of criteria you are accustomed to applying to traditional behavioral modeling can help reduce the complexity of your shared model code, as well. Tasks you should not need to model include the following:

  • POST routines
  • Encryption (unless needed for SITL, in which case you should include a way to turn it on/off)
  • Functions related to the real hardware, such as outputting a status, generating log files, and performing hardware self-diagnostics (include a way to turn these functions on/off)

Which Tasks Will Be Highly Implementation Specific?

Some tasks will be closely tied to the hardware on which the real code will run. For these, you will need different implementations for the real code and the model. For example:

  • the NDIS calls in a Windows device driver will need some alternate mechanism in an Riverbed model
  • changing the transmit frequency for a software-defined radio will probably use some custom API for the hardware, but involve simply setting an attribute value on an object in the model

本站文档由 北京智网畅联科技有限公司 整理、翻译并提供 · Documentation compiled and provided by Beijing ZNetLink Technology Co., Ltd.

交流群 · QQ Group:OPNET/智网妙算网络仿真交流群(群号 486383494)

原文档 © 2017 Riverbed Technology · 本站为公益翻译,由 AI 辅助完成,请仔细甄别

Original documentation © 2017 Riverbed Technology. Community translation, AI-assisted. Contact: jiazequn@znetlink.com