260 likes | 792 Views
Real-Time Calculus 工具箱 介绍 ——Modular Performance Analysis. www.mpa.ethz.ch. Deterministic NC 和 Real-Time Calculus. . h ( , ). . v ( , ). 应用领域扩展 + M odular Performance Analysis (MPA) 思想. quoted:.
E N D
Real-Time Calculus工具箱 介绍——Modular Performance Analysis www.mpa.ethz.ch
Deterministic NC 和 Real-Time Calculus h(,) v(,) 应用领域扩展+Modular Performance Analysis (MPA) 思想
quoted: • “The central idea of Modular Performance Analysis is, to first build a so-called performance model of the concrete system that bundles all information needed for performance analysis with Real-Time Calculus. The abstract performance model thereby unifies essential information about theenvironment, about the available computation and communication resources, about the application tasks and dedicated HW/SW components, as well as about the system architecture itself. ”
下载安装 • install.txt文件 • …Copy or move the directory rtc to its final installation destination, e.g. to $MATLAB$/toolbox/rtc • Open Matlab and change to the rtc directory: >> cd $MATLAB$/toolbox/rtc • Run: >> rtc_install
(8,9) 斜率0.25 offset=2 y=0 截距为0 p=5 周期5 RTC Toolbox Tutorial • rtc曲线、rtc曲线叠加、rtc曲线绘图 f = rtccurve([[0 1 1];[8 9 0.25]]); g = rtccurve([[0 1 0];[1 2 0]], 0, 5, 2); h = rtcplus(f, g); rtcplot(f, 'r', g, 'b', h, 'g', 20); 除了rtcplot()之外,还有 rtcminus() rtcmax() rtcmin() rtcdivide() rtctimes() rtcceil() rtcfloor() rtc工具箱中规定p只能取整数
p=5 周期5 o=4 offset=4 注意这里说的offset是纵轴的偏移,不是相位的偏移 RTC Toolbox Tutorial • 带有非周期段 f = rtccurve([[0 2 2]], [[0 0 1];[2 2 0.25]], 3, 10, 5, 4); (3, 10)
RTC Toolbox Tutorial • 带有非周期段 f = rtccurve([[0 2 2]], [[0 0 1];[2 2 0.25]], 3, 10, 5, 4); % If the end point of a curve segment does not coincide with the start % point of the next curve segment, then the curve exhibits a discontinuity % at this point. %The RTC Toolbox does not define whether a discontinuity is % treated as left- or right-continuous. However, the various functions of % the RTC Toolbox will interpret a discontinuity correctly as either left- % or right-continuous depending on the context of the curve.
The following command plots f in a range 10 <= x <= 20 and 12 <= y <= 22 • rtcplot(f, [10 20 12 22]); • The export function can be used to export curves into a text file for later use. • rtcexport(f) • 为使Matlab打印,不要打“;”
仿射(affine)变换 rtcaffine() • h(x) = f(1/a*(x-b)) f = rtccurve([[0 2 2]], [[0 0 1];[2 2 0.25]], 3, 5); h = rtcaffine(f, 0.4, 3); rtcplot(f, 'g--', h, 'r', 20); rtc工具箱中规定:如果全部或部分具有周期参数p a*p只能是正整数
Min-Plus/Max-Plus代数 • 最小加卷积rtcminconv() g h=f g f
Min-Plus/Max-Plus代数 • 最小加解卷积 rtcmindeconv() (fØ g)(Δ) = h=f g f g
计算可视化 • rtcplotbounds( ) rtcploth( )rtcplotv( )
而且,可以得到结果! 算最大的水平距离d = rtch(f, g) 计算最大的垂直距离d = rtcv(f, g) Min-Plus/Max-Plus代数 >> f = rtccurve([[0 2 2]], [[0 0 1];[2 2 0.25]], 3, 5); >> g = rtccurve([[0 0 0];[5 0 1];[10 5 2]]); >> rtcplot(f, 'r--', g, 'b--', 20); >> d = rtcplotv(f, g) d = 10
MPA • “The Modular Performance Analysis framework consistently uses a set of an upper as well a lower curve to model event streams or resources. ” • 到达曲线——事件流模型 • period, jitter, distance • e.g. a = rtcpjd(3, 5, 1) 这里为了避免过于悲观distance – a minimum inter arrival distance p j=5 对于lower bound是p+j,右移对于upper bound左移
MPA • 服务曲线 • rtcfsu()和 rtcfsl() ——上限和下限 • rtcbd() —— 这里“bd”是boundeddelay的意思 • rtcps() —— 周期性的服务曲线(类TDMA) • p – period s – share 还有B – bandwidth • 最坏,上次没share着,要多等p-s;自好,deferrable b = rtcps(2, 5, 1); b1 = rtcps(1, 3, 0.5); rtcbd(4, 0.3) b b1
MPA——组件模型 • 例如: • “The rtcgpc() function computes the output of a greedy processing component. A greedy processing component is commonly used to model a single preemptive task(网络不是可抢占的,这是对处理建模) running under a fixed priority scheduling policy.”
例如:(代码) a_in = rtcpjd(3, 0, 0); b_in = rtctdma(2, 7, 4); ed = 3;%execution demand [a_out b_out del buf] = rtcgpc(a_in, b_in, ed); 得到结果:del = 6.2500 buf = 3
MPA——模块化… • 例如:
Acknowledgement • 本PPT中的大部分图片来自于ETH开发的“rtc工具箱”的Tutorial文档及其MatlabTM代码输出 Thanks!