tag 标签: wysiwyg

相关博文
  • 热度 25
    2013-12-12 10:01
    2111 次阅读|
    2 个评论
    StratixII之EDA及学术开发功能描述 1.概述 同Stratix/Cyclone。 2.逻辑单元(Logic Cell)描述 在以前的架构中(比如Cyclone),单个LE包括一个组合逻辑和寄存器。对于Stratix II来说,组合逻辑和寄存器被单独分开到两个部分,原语创建的时候也不象Cyclone和Stratix那样,而是通过lcell_comb(组合逻辑部分)和lcell_ff(flip-flop/register)分别创建。这和CycloneII的情形有点类似。注意这里的flip-flop和register的意思可以互换。 图1显示了StratixII寄存器逻辑单元完整功能框图,它有八个输入,分别是datain、adatasdata、clk、ena、sload、sclr、aload和aclr,同时只有一个输出regout。 图1:Stratix II寄存器逻辑单元完整功能框图 图2显示了Stratixii组合逻辑单元完整的功能框图,它有八个输入端口,分别是dataa、datab、datac、datad、datae、dataf、sharein和cin,以及四个输出端口,分别是shareout、cout、sumout和combout。 图2:Stratix II组合逻辑单元完整功能框图 3.坐标系统和位置约束 图3:StratixII坐标系统 图3显示了Stratix II器件底层坐标系统,坐标标注和Stratix/Cyclone类似,这里不赘述。只是从CycloneII开始,根据上述LE的结构分析,可以直接单独给lcell_comb或者lcell_ff约束位置了。这在FPGA TDC设计中延时链锁定有一定好处,同时增加了具体的工作量,因为你必须分别约束组合逻辑阵列和寄存器阵列。 可以看到M-RAM占了很大一块,一个基本坐标单元是一个LAB的位置大小。那么一个M-RAM占据的位置相当于3x4=12个LAB的面积。每个LAB有(x,y)坐标,而其内部的lcell_comb和lcell_ff又有子坐标,比如lcell_comb_X2_Y5_N4。ALTERA的意思是不建议这样按数字从上到下约束组合逻辑单元或者寄存器单元的位置,因为这样常常给fitter来麻烦,最好的办法是仅仅约束LAB的位置。 4.布线延迟与布线距离以及布线规则的关系 略,同CII 5.Netlist Recommendations 略,同II。但是由于逻辑单元端口有差别,所以表1的内容和CII有区别。 表1: 6.综合概览和优化 6.1 ALM和LAB的相关描述 第二节描述了Stratix II器件使用的基本逻辑单元,Quartus II开发软件将这些逻辑单元打包进两种结构,即ALM和LAB。这两种结构除了单独逻辑单元自己的限制外还有一些额外的限制。后面我们将讨论这些限制规则。 一个ALM(Adaptive Logic Module)包括最多2个lcell_comb模块和2个lcell_ff模块,如图4所示。Note that not all positions in an ALM need necessarily be populated with a logic cell for theALM to be valid. 图4:一个ALM中的逻辑单元(Logic Cell) Stratix II的一个LAB中有8个ALM,所以一个LAB中有32个逻辑单元(Logic cell)(16个lcell_comb和16个lcell_ff)。如图5所示,32个单元组成了一个LAB,灰色的为lcell_comb,白色的为lcell_ff,每个虚线框表示一个ALM,如前所述,位置信息显示是ALM的可能位置信息,用户逻辑电路并不一定在fit后会使用到。 注意图5中灰色所示的所有lcell_comb位置标号都是偶数,而白色所示的lcell_ff位置标号都是奇数,这些信息用户在ChipPlanner或者资源属性编辑器中看得到。如果我们要约束lcell_comb和lcell_ff位置,那么如图3所示找到这些逻辑单元所在的LAB坐标,然后确定该逻辑单元的位置,比如将一个lcell_comb进行位置约束如lcell_comb_X4_Y6_N0,就是将其约束位于图5所示ALM#1中,将一个lcell_ff进行位置约束如lcell_ff_X4_Y6_N7,就是将其约束位于图5所示的ALM#2中的第二个寄存器。 图5:Stratix II器件中的LAB 6.2 测量综合面积质量 因为组合逻辑单元(lcell_comb)可以以不同的方式组合起来,形成ALM,所以测量综合面积不是单单象统计创建的逻辑单元那样简单。从面积角度来看,当fitter争取最大密度努力时,综合将创建最少的ALM和LAB。我们来看一个很简单例子,80个6输入lcell_comb单元可能要消耗80个ALM(因为一个ALM只有在满足LUT掩码要求的情况下才可能实现两个6输入函数),而100个4输入lcell_comb仅消耗50个ALM(因为一个ALM总是包含2个四输入函数)。从电路面积角度来说,消耗最小面积的综合效果是最好的。 在Altera提供的quartus.ini文件中,包含这样的信息“fit_pack_for_density=on”和“fit_report_lab_usage _stats=on”,这些都将允许精确的面积估算。当这些变量使用的时候,Quartus II软件将试图通过Packing逻辑单元(Logic Cell)进ALM和LAB来达到最小化面积,特别是同时可以接受Fmax有很小幅降低的时候。Quartus II软件同时会给用户打印以下信息: Info: Number of LABs at the end of packing: 100 Info: Number of LEs at the end of packing: 1600 来说明当它fit电路的时候,最小的ALM和LAB使用量。当然当综合算法中的最大电路速度被执行,那么Quratus II软件运行的时候不带上述变量。 最好的办法是在工程的qsf文件中添加以下的编译设置: set_global_assignment –name INI_VARS "fit_pack_for_density=on;fit_report_lab_usage_ stats=on” 注意上述约束行中的引号中不能包含任何空格。 6.3获得好的面积及性能建议 通常来说,最好是使用6输入函数来减少电路深度从而提高电路的性能。在那些不影响电路深度的情况最好是使用6输入函数,这些情况有,如果6输入函数能节约多于两个5或者更少输入函数,或者ALM的掩码支持2个6输入函数。 6.4获得好的Fitting结果建议 1. 使用lcell_ff的.sclr应当慎重,Cyclone II架构中一个LAB最多只有一个.sclr 。不恰当地使用这个端口,会大幅降低逻辑资源利用率、fitting通过的可能性以及电路速度。举个例子,过去常常在一个逻辑单元里使用.sclr 端口来产生一个5输入函数,如此在实现这个电路的时候可以减少逻辑单元的数量,因此从一个综合角度来看这也许是一个好主意。但是,一旦这个lcell_ff使用了.sclr,那么这个lcell_ff所在的LAB一般无法将其它寄存器逻辑单元打包(Pack)进来,除非这些寄存器逻辑单元都使用同样的.sclr值或者它们的synch_mode=off。这可能在最坏情况下导致逻辑密度大量减少,因为只有一个lcell_ff可以被放置在一个LAB中,而不是16个。所以无原则地使用.sclr会导致非常坏的fitter结果和电路速度,因为fitter在这种情况将lcell_ff组合进LAB的灵活性非常小。 .sclr应该只有在用户电路中实现同步清零的时候才被使用,因为在这种情况下同步清零信号一般产生非常大的扇出。因此,fitter一般不会过分约束同步清零信号。.sclr端口也可以审慎地用于实现其他中等扇出信号,用来减少逻辑单元的使用量。 2.         上述原则同样适用于.sload 端口。同步加载应当会产生高扇出。 3.         时钟使能(.ena)使用起来相对有点宽松,因为每个LAB允许有三个不同的.ena值,这比只有一个.ena值大大提高了fitter应对多.ena值情况的能力。不过,过多的时钟使能(.ena)使得获取高逻辑利用率非常困难。我们发现电路如果使用成千上万的时钟使能,APEX通常往往逻辑利用率只能达到90%。更谨慎地使用时钟使能,常常能达到99%的逻辑利用率。因此,注意限制不同.ena信号的数量(尤其是低扇出信号)还是值得的。Stratix II比之前器件多出一个时钟使能端口,所以相对要宽松。 4.         到LAB的总的布线信号是44个(不包括cin和LAB内逻辑单元生成的信号),所以为了更好的布通性,最好使用不超过38个不同的信号布线到同一个一个LAB(不包括clk和aclr,它们可以使用全局资源)。 5.         Fitter将会在需要的时候将lcell_comb单元和lcell_ff单元“打包”一起放入一个ALM中。如此,综合阶段没有必要将二者放在一起。然而,需要注意的是单元创建的时候不要对fitter打包lcell_comb和lcell_ff进同一个LE产生不利影响。 6.         如图4所示的ALM总共包括2个lcell_comb和2个lecll_ff,表2显示了除了逻辑单元自己的限制外的lcell_comb单元组合到一个ALM的一些限制。该表并没与显示出每一种可能的lcell_comb组合,详细的情况可以查看Stratix II的LCELL所见即所得相关文档。 表2:聚合lcell_comb进入ALM的限制情况 Lcell_comb类型选择没有意义,只有当使用6输入函数有明确的优势的时候可以采用,比如需要减少电路深度或者电路面积的时候可以选择使用6输入函数。如果没有严格限制一定要使用6输入函数,最好使用更小输入函数,因为如上表所示,输入端口越少,限制也越少。 7.逻辑单元(Logic Cell)规则 7.1 对单个寄存器逻辑单元(lcell_ff)进行约束 1.如果clk端口连接,那么regout端口必须连接 2.如果sclr端口连接,那么clk端口必须连接 3.如果sload端口连接,那么clk端口必须连接 4.如果ena端口连接,那么clk端口必须连接 7.2 对单个组合逻辑单元(lcell_comb)进行约束 1.Cin端口不连接,要连接必须连接到GND或者连接到另一个lcell_comb的cout端口。如果一个lcell_comb的cin连接到另一个lcell_comb的cout端口,那么该lcell_comb使用的时候其SUMOUT或COUT一定要受到cin端口的影响。 2.Cout端口必须根据上一条连接,或者保持不连接 3.Sharein端口可能被连接只有当cin被连接且该lecll_comb的参数shared_arith = on。 4.如果sharein连接,它可以连接到GND或者必须由驱动本本lcell_comb的cin端口的lcell_comb的shareout驱动 5.Shareout端口只有在cout端口连接的时候才能被连接 6.当shareout端口连接的时候,它必须驱动被本lcell_comb的cout驱动的同一个lcell_comb的sharein端口 7.如果cout/cin连接,但是sharein/shareout没有连接,那么只有dataa,datab,datac,datad和dataf输入端口可以使用。 8.如果参数shared_arith =  on(即sharein/shareout连接),那么只有dataa,datab,datac,datad和dataf输入端口可以使用,dataf端口只影响该lcell_comb的组合逻辑输出,即combout。 9.在一个lcell_comb中,如果一个输入连接有信号,但是该信号依据LUT掩码没有影响至少一个输出,那么这是违法的,作为规则,Quartus II软件将Disconnect这个输入。 10.LUT掩码依赖一个没有任何信号连接的输入端口也是不合法的。 8.ALM和LAB规则 本节讨论一下综合器应当遵守的规则,依据这些规则产生的逻辑单元才具有电气特性,逻辑单元组合进LE和LAB的时候才能形成合法的LAB可布通性。 8.1约束LABs的进位链 进位链概念省略。如图3所示的连续相连的灰色(偶数)lcell_comb可以组成进位链。长进位链跨多个LAB的时候必须从上一个LAB直接跨入紧邻的下一个LAB,只能从上到下连接。需要注意的是StratixII中的进位链连接时,sharein和shareout的是否连接是可选的。相对比较以前器件结构,在StratixII架构中创建一个非法的进位链是不可能的,因为lcell_comb和lcell_ff无法合并进同一个LE中。 进位链的起始位置总是固定在一些特定位置的carryin/sharein,fitter可以分配一个进位链从一个LAB的子坐标(sub-location)0或者16开始(因为只有这些子坐标位置才有进位链输入的tie-off。笔者注:什么是“tie-off”)。如果这对于某个特殊设计是一个很大的限制,那么fitter可以插入一个lecll_comb单元来为进位链创建一个固定的carryin/sharein作为该链的起始。这个增加的lcell_comb的所有其他输入端口都未连接(或者都连接到VCC或GND),而只连接carryout端口(shareout端口也可能连接)到另一个lcell_comb的carryin端口。使用这种技术,fitter可以将一个进位链放置在任何LAB子坐标。 长进位链跨多个LAB的时候必须从上一个LAB直接跨入紧邻的下一个LAB,只能从上到下连接。 Stratix II的ALM可以实现8输入的算术功能,如果某个使用了整个LAB中8个ALM的链很可能使得这个LAB没有足够的输入端口来实现该链。在这些情况下,fitter会自动将这个链分成小链,并将这些小链只fit进半个LAB。这些小链将使用下面介绍到的“early exit”和“late entry”模块完成LAB之间的连接。 被放置在LAB子坐标0、4、8、和12位置的链使得其可以从这个LAB的中间离开并从下一个LAB起始的子坐标0继续。这就是所谓的“early exit”模式。链从一个LAB末尾(即子坐标30)离开,使得其有可能从下一个LAB的中间(即子坐标16)进入。这就是所谓的“late entry”模式。Stratix II器件的LAB列只能交替地支持上述模式中的一种,即某个LAB支持哪种模式取决于该LAB的列位置。图6显示了上述内容。 fitter除了使用上述early exit和late entry模式来打开进位链以外,还会使用通用布线资源(即不使用专用的carryin和carryout连接)在LAB之间连接链。如果fitter这样做了,软件会给出一个相关警告信息。 图6:early exit和late entry跨LAB的进位链 8.2约束进位链到ALM 进位链意味着一组相邻的ALM被打包在一起,这样就需要满意的ALM设置。比如,进位链的第一个和第二个lcell_comb必须位于同一个ALM中,第三个和第四个必须位于下一个ALM中,等等。图7显示了ALM中的这些进位单元。 图7:聚合进位链进ALM 图7所示的进位链相邻进位单元必须遵守下列ALM合法规则: 1.它们必须处于相同的共享算术模式(即两个进位单元要么sharein/shareout都连接,要么都不连接)。需要注意的是链中不同ALM的LUT可以毫无限制地配置成shared或者non-shared模式,只要同一个ALM中的LUT配置成相同的模式即可。 2.连接到lcell_comb端口dataa、datab和两个lcell_comb的datac的不同信号数目不能多于4个。这是因为这三个端口中的两个必须由这两个lcell_comb共享。个人觉得应该是dataa和datab在一个ALM中是由其中的两个组合逻辑单元共享,而datac应该上下有不同的datac端口。 图8显示了一个遵守规则2和一个不遵守的例子。合法的ALM有信号s1、s2、s3和s6连接到ALM的两个lcell_comb的端口dataa、datab和datac上,而非法的ALM有s1、s2、s3、s6、s7和s8六个信号连接到ALM的两个lcell_comb的端口dataa、datab和datac上。 图8:规则2合法和非法实例 8.3约束LAB-wide信号 好多连接到逻辑单元的信号叫做“LAB-wide”信号,这些信号单独为LAB产生并可以由LAB内的逻辑共享。因此,在一个LAB布置的逻辑单元如果需要过多的LAB-wide信号将是非法的。 上一节讨论的进位链,虽然进位自己不会有错,当进位链中每个逻辑单元要驱动寄存器单元的时候,这些进位链结构常常会导致比较差的fit结果。我们最好来看这样一个例子,假如一个长度为6的进位链(横跨3个ALM),进位链每个逻辑单元驱动一个寄存器,同时每个寄存器的使用不一样的时钟信号,那么进位链所在的这个LAB最多只能放入这些寄存器中的两个,因为每个LAB最多只支持两个不同的时钟信号。因此,这只会带来比较次优的布局结构,如图9所示。 在Stratix II器件中,连接到lcell_ff的clk,ena,aclr,aload,sclr和sload端口的信号都属于LAB-wide信号。一个lcell_ff端口连接到一个正常信号都消耗一个LAB-wide信号,同一个信号被取反后在LAB中使用也额外消耗一个LAB-wide信号。所以如果LAB中的一个lcell_ff使用clock,而!clock被另一个lcell_ff使用,那么将消耗两个LAB-wide信号。逻辑单元上连接到VCC和GND的端口也需要LAB-wide线。还有一种情况是逻辑单元某些端口处于悬空状态,这种unconnect情况可能需要LAB-wide线,也可能不需要,这取决于端口以及LE的配置。表3显示了lecll_ff中悬空端口的处理情况。 图9:过多LAB-wide被使用的时候地布局影响 表3:端口未连接时是否被认为“used” 下列都是表3定义的重要的规则,用于统计被认为“used”但是却未连接信号的寄存器端口。 1.所有lecll_ff上的.clk和.ena信号都成对地组成LE时钟,如图10所示。在任何LAB中,可以有不超过2个不同的时钟对。 l  同一个.clk信号和2个不同的.ena信号可认为是两个不同的寄存器时钟对 l  同一个.ena信号和2个不同的.clk信号可认为是两个不同的寄存器时钟对 图10:形成lcell_ff时钟的时钟和时钟使能组合 2.最多只有两个不同的时钟信号可以连接到clk端口 表4显示了一个时钟加时钟使能如何创建时钟对的例子。该例显示了三个的寄存器使用的三组时钟和三组时钟使能,clk(#1)和ena(#1)属于register Cell(#1),clk(#2)和ena(#2)属于register Cell(#2)。没有连接的.ena端口被配置为VCC,如表3指定那样。A,B,C、D,E和F对应信号网络。 表4:时钟和时钟使能如何组成lcell_ff时钟的例子(所有单元的.regout连接) 3. 最多2个不同的信号可能被连接到.aclr端口。(从表2,未连接的.aclr将会认为是连接到GND) 4. 最多只有一个不同的信号可以连接到aload端口 5. 如果任何LAB中的一个lcell_ff使用了alod端口,那么: l  该LAB中所有使用aload的lcell_ff必须使用和第一个lcell_ff相同的aclr l  该LAB中所有未使用aload的lcell_ff必须使用相同的aclr 6. 最多只有一个不同信号能被连接到.sload端口,最多只有一个不同信号能被连接到.sclr端口 l  一个lcell_ff使用sload和(或)sclr只能被放置在一个使用相同sload和(或)sclr或者不使用sload和(或)sclr的LAB中。 表4显示了sload和sclr组合是否被认为“used”的情况,表5则显示了sload和sclr组合被合法布局到一个LAB的例子。两个表中的A和B都是指非GND和非VCC的信号网络。 表5:当sload和sclr被认为“used”的例子 表6:lcell_ff使用sload和sclr的合法和非法组合 注:表5和表6中A和B均为非VCC和非GND的信号网络。 8.3LAB控制信号可布通性约束 这里有一些规则可以确保LAB内所有必需的控制信号能被布局进这个LAB。任何连接到逻辑单元端口的信号网络(非VCC和非GND),如果其未使用全局布线资源,那么它布进LAB,需要占用LAB-wide输入端口。一个信号如果在LAB内正和负都被用到,那么该信号必须被布线两次。如果一个逻辑单元的一个端口连接(或者说可以如表3那样认为连接)到VCC或者GND信号,那么它可能需要也可能不需要占用LAB-wide输入端口,这取决于这个端口是否存在LAB-wide tie-off。表7显示了lcell_ff的哪些端口连接到一个信号或者连接(或者说可以如表3那样认为连接)到VCC或者GND时需要LAB-wide输入端口的情况。 表7:VCC/GND需要布线进LAB的情况(*为不同于Stratix) 以下是一些重要规则,依据表7定义VCC/GND需要布线资源。 1.下面这些不同信号最大数目只能是6个 l  Clk(非全局) l  Ena l  Aload l  Sload l  Aclr(非全局) l  Sclr 2. 下面这些不同信号最大数目只能是5个 l  Ena l  Aload l  Sload l  Aclr(非全局) l  Sclr 3. 下列信号最多只能有3个不同:This is due to the fact that sload steals a non-global clk line. l  ena l  aload 4. 下列信号最多只能有2个不同:This is due to the fact that sload steals a non-global clk line. l  clk(非全局) l  sload 5. 下列信号不同组合最多不超过3,这是因为非时钟和非aclr全局信号必须通过普通LAB线布进LAB,同时连接全局走线和LAB线是有限制的。 l  Ena(global) l  aload(global) l  sload(global) l  sclr(global)
  • 热度 23
    2013-12-8 11:13
    3288 次阅读|
    2 个评论
    WYSIWYG,所见即所得,即What you see is what you get的缩写。最近在altera的英文论坛跟人交流TDC设计心得,觉得对于FPGA的底层结构能了解还是尽量了解。论坛中设计基于FPGA的TDC的同仁分享了一篇Cyclone II的LE所见即所得文档,觉得对笔者理解之前设计fpga-tdc过程遇到的一些疑惑还是很有帮助的。   这些所谓的所见即所得原语虽然大部分内容在器件的handbook里能找到,但是一些关键性的细节就是如此庞大的器件手册有时候也是不会提供给客户的,反而是这些老掉牙的WYSIWYG文档里有详细的介绍。   举个很简单的例子,设计fpga-tdc的时候我非常怀疑这个LE或者ALM的输入端口有一个“取反”的模块,但是你所能查到所有的LE或者ALM资料或者直接从Quartus II软件的chipplanner查看都看不到这个相应的“取反”结构。而在这些WYSIWYG文档里我找到了明确的答案,即大部分原语输入端口都有一个可编程(programmable)取反器。   更重要的是,很好的理解了这些底层的基本单元,对于以后更好地设计FPGA非常有帮助的。   后面计划分批整理以及翻译这些所见即所得文档,由于首先拿到的是Cyclon II的LE,所以后续文档都以这个文档为基础,因为通过快速浏览发现这类文档都是相同结构,而且同一系列器件内容雷同。比如其实CycloneII是在Stratix/Cyclone基础上编写;而Stratix III又是在Stratix II基础上编写,因为同一系列大部分原语(primitive)基本相同,我整理的时候每一个系列只整理一个详细的,然后雷同的只做差异比较即可。
  • 热度 22
    2011-6-25 16:12
    3388 次阅读|
    0 个评论
      Generating print for textbooks is one thing. For a single scientist or small group, generating it for published papers was quite another. I well remember serious technical papers written on a typewriter, with all the math equations written by hand. Or, not much better, generated by a typist skilled in typing subscripts, superscripts, and Greek letters. It was only natural that we average computer users would yearn to be able to generate book-quality print and equations, from a computer. In other words, let the text output of a general-purpose computer be the text input to a typesetting system. One of the early typesetting systems was the Unix program, troff. Another was Donald Knuth's justly famous T E X, developed ca. 1980. To see the quadratic formula written in T E X, go to http://en.wikipedia.org/wiki/TeX . The problem with troff and T E X was that you couldn't actually see their output until it went to the typesetter or a pixel-capable printer. The input itself was still a mere text string. WYSIWYG changes everything All that changed when Apple introduced its ground-breaking MacIntosh computer, with its high-resolution pixel graphics and a laser printer to match. Suddenly, an affordable personal computer could generate output rivaling the book publishers. Seemingly the next day, Microsoft came out with Word for the Mac, and we learned that we no longer had to deal with Courier-in, Courier-out text. We could see on the screen the printed page exactly as it would appear. WYSIWYG was upon us with a vengeance, and we'd never be satisfied with pure text editing again. If we could create text and graphics on a personal computer, it was only natural that we'd want to create math equations as well. Microsoft came through again, with its Microsoft Equation Editor, based on Design Sciences very excellent MathType. It's Word with MathType that I use for all my columns you've seen. Tying things together As nice as the output of WYSIWYG editors with equation editing was, it was still completely dumb. Mathtype, like troff and T E X, has no smarts behind it. You have to put the symbols where you want them, one by one. Symbolic math processing remained a largely text-only operation. Math aids like MacSyma, Maple, and Mathematica (loosely derived from MacSyma) still used ordinary text strings for input and output. Mathematica at least made an attempt to pretty-print math equations, by simply printing their parts on separate lines. But the results were a far cry from book-publishable. The next step is obvious: Give me a math analysis program that lets me input my equations in a form that looks just like a book publisher might typeset it, and give me the results the same way. This is where Mathcad comes in. To my knowledge, it was the very first personal computer program capable of accepting symbolic inputs in natural mathematical form, performing operations on them symbolically, and showing the results in the same form. As far as I'm concern, they still remain alone. In fairness, Maple too has evolved over the years, and later versions do indeed support mathematical forms for both inputs and outputs. But, for me at least, the text-oriented nature underpinning Maple still shows through. The math expressions are basically sleight-of-hand tricks to hide its inherent nature. A lot of my work involves deriving the math equations associated with new problems and documenting the results. For me, it's important that I be able to intermix text with math equations, as well as the numerical and symbolic computations associated with them. Only Mathcad can do this seamlessly. Which is why I use it. How hard can it be? While the ability to input equations in WYSIWYG form is Mathcad's strength, you should never get the idea that it's easy to do. It's not, and that's because the most convenient input device remains the keyboard. So how do you get the computer to accept text inputs and display the equivalent WYSIWYG form? Granted, I should be able to type a "Fortranish" character string like: "x = a+b+2*y" And get: x = a + b +2 ? y But try to get fancier, and things start to go south in a hurry. Type the harmonic series: "x = 1+1/2+1/3+1/4+..." And you might be surprised by the result. It'll be: Mathcad understands operator precedence but can't possibly know your intentions unless you tell it. Think about it for awhile, and you'll realize that you can't possibly avoid the need to navigate around inside an equation, selecting the place where you want to put the next symbol. To do it, you're going to need to use the navigation keys, plus some special keys for things like superscripts, subscripts, square root symbols, matrix operations, and the like. It's this navigation that's the hard part. It gets even harder when you're not just inputting an expression from scratch, but modifying an existing one. Or, worse yet, editing the output of the symbolic processor. Over the years, the Mathcad folks have tried several schemes, each with their pros and cons. This is the big area of change in Mathcad Prime 1.0. They've completely replaced the user interface, including the rules for navigating inside expressions. It's the area of the program that elicited by far my most vociferous comments and under-the-breath curses. And the new interface is exactly what I had hoped for. It's a dramatic change, and it's the reason I'm so excited about Mathcad 1.0 Prime. Still incomplete Now for the bad news: Mathcad Prime 1.0 is still not complete. In developing it, PTC decided—wisely, in my opinion—not to put things in until they were robust and fully refactored. So key parts of earlier versions are still missing, notably the symbolic processing. What's that you say? A symbolic processing program that can't do symbolic processing? Well, don't forget that symbolics is far from Mathcad's only function. It can also do ordinary numerical computations, vector/matrix operations, graphing, and much more, just as Mathematica, Maple, Matlab, and others do. Plus a bewildering array of special functions and numerical methods. It's only the connection with the symbolic engine that's missing. To complete the picture, PTC has a plan. First, the purchase price of Prime 1.0 includes a maintenance contract, providing free upgrades for a year. They expect that, long before the year is out, the missing features will be included. To cover the missing features in the interim, they're bundling Prime 1.0 with a new version, Version 15, of the old Mathcad. Can you tell that I'm excited? I think it's a great plan, and a great product. If you have a need for math processing, I think you should take a hard look at Mathcad Prime 1.0. If you've been avoiding Mathcad because of its steep learning curve or my dire warnings, it's time to take another look.  
  • 热度 27
    2011-6-21 10:32
    3494 次阅读|
    0 个评论
    There's some exciting news about a product I've lived with—and sometimes praised, sometimes cursed—for decades: Mathcad, PTC's premier math analysis tool. Regular readers know that most of my columns are math-oriented, as is most of my work. For that reason, I'm a heavy user of Mathcad. For more than 15 years, I've maintained a love-hate relationship with Mathcad. I've mentioned it many times in my columns, in terms ranging from wholehearted endorsements to heated, curmudgeonly rants. Although I often curse Mathcad as I use it, the reality is it remains, by far, the most oft-used tool in my toolbox. Why do I continue to use Mathcad when it frustrates me so? To quote the old joke, it's the only game in town. Oh, yes, other math analysis tools exist—some with more impressive resumes, more respected pedigrees, and much higher prices. But none of them do quite what I want done. For me, Mathcad stands alone. The reasons are part of this story. I've not told just you readers my beefs about Mathcad. I've also communicated them to Mathsoft and now PTC. I've talked to people from technical support—very excellent people, by the way—to vice presidents. I've posted my opinions on their web sites and blogs. I was a long-time member of their "Power Users' Group," and I still post from time to time in the Mathcad Community site. I've given them so much "feedback," I think they must surely cringe when they hear my cybernetic footsteps. Do you get the idea that I am not among Mathcad's biggest fans? Then what I have to tell you next should carry all the more weight. PTC has recently announced a new version of Mathcad. It's called Mathcad Prime 1.0, and it represents a bold and dramatic departure from older versions. No, belay that. Prime 1.0 isn't just yet another version, the 16th of 16. It's a brand new product, written on a blank sheet of paper and built from scratch to new specifications. You have to admire the courage of a company willing to invest the time and money in these precarious times. More importantly for me, the user interface—the part that elicited most of my rants—is radically new. I don't deceive myself that PTC made the changes just for me, but it's as though they were reading my mail (hey, maybe they were). As near as I can tell, every one of the idiosyncrasies I used to fuss about has not just been changed, but changed in just the way I'd hoped for, It's an awesome turn of events, and I'm very excited about it. Can you tell? The back story What is a math aid, anyhow? Well, it's something that makes doing math easier. Until the advent of digital computers, we all used to do math the same way the Sumerians and Egyptians did it: First with stylus and clay, then quill and papyrus, later pencil and paper. What alternatives did we have? When you're doing long math calculations, it's easy to get something wrong. The great astronomer, Ernest William Brown, developed a theory for the motion of the Moon, in terms of a trigonometric series with some 1,500 terms. Later, it was discovered that he'd made an error in the 500th term, give or take, rendering the next 1,000 terms useless. My own favorite errors were stupid ones; getting a sign wrong, or leaving out a factor of 2. I often wished I could hire an apprentice, whose only job would be to check my math and catch those errors. Or, better yet, do the tedious, turn-the-crank manipulations for me. Just say, "start with these equations, and solve for x." The ideal apprentice would know the rules of algebra, trig, and calculus. Such an idea became practical with the advent of digital computers. Computers don't just crunch numbers. They can also deal with concepts. The rules of algebra, operator precedence, and so forth, are well known and never change. Ditto for the rules of calculus and trig identities. If we can explain the rules, a computer program can do all the tedious work. And it won't get the sign wrong. One of the earliest math analysis tools was Macsyma, developed at MIT and refined in various commercial forms. Versions of Macsyma, highly refined, are still with us today. You must understand: in those days, the acronym WYSIWYG wasn't even on the radar. We gave computers data by punching text into IBM cards or paper tape, and they gave stuff back by printing them on a chain printer (very fast, very loud). In a real sense, a computer program only changed one text string to another. There was no hope to input formulas as they'd look in a math textbook. If you wanted to write an equation like the quadratic formula: You had to convert it to its equivalent Fortran form: X1 = (-B + SQRT(B**2—4*A*C)/(2*A) X2 = (-B—SQRT(B**2—4*A*C)/(2*A) Macsyma's forte' was symbolic processing. That is, it could take an expression and transform it into an equivalent one, using the rules of algebra, trig, and calculus. Macsyma was, in fact, one of the very first knowledge-based systems. But it could only operate on Fortran inputs, and it could only give back more of the same. One of its most important applications was in taking the calculus derivatives of expressions. I once got to see Macsyma used—or misused. A company building robotics controllers was writing new embedded software, and they needed to implement the rather complicated vector/matrix math and Euler angle rotations. The project lead had a most boneheaded idea. Arguing that calling functions and subroutines would be "too inefficient," he decided to get Macsyma to expand them all into scalar equations involving a whole lot of trig functions. He chose Macsyma to expand the equations into Fortran. Pages and pages of it. Then he turned the Fortran over to a bunch of new-hire programmers, trained in C. Their job: To turn the Fortran into yet another language: Pascal. Think that was efficient? Most computer programs don't yet have the intelligence to say, "You want me to do WHAT?" Maple and friends The folks at Waterloo University in Waterloo, Ontario, Canada enjoy a long and honored reputation in the fields of language translation and symbolic computations. In the 1960s, computer science departments all over the world were hurting because of all the students running Fortran jobs for class credit. What the world needed, the educators pleaded, was a Fortran compiler system that would read the students' programs, compile, link, and run them, all in one batch process. IBM experts said building such a system was impractical, if not impossible. Someone forgot to tell the folks at Waterloo, so they just went and built it. They called it Watfor. A similar situation came up around 1980. The story goes that the Waterloo folks wanted to run Macsyma, but couldn't afford the large mainframe computer it required. So they wrote a symbolic engine of their own. They called it Maple. Over the years, Maple has continued to evolve and is generally considered to be one of the premier symbolic engines of all time. It's commercially available today, from Maplesoft. The printed page While we technical types were learning to computerize the processing of math equations, another group had been routinely creating more beautiful equations for centuries. These were the book publishers, who published, among other things, the math textbooks from which we learned our craft. It was only natural that typesetting systems evolved into computer systems capable of driving automated typesetting machinery.