您好,欢迎访问三七文档
Verilog-ALanguageByWilliamVidesModfiedbyGeorgeEngelDifferencebetweenDigitalandAnalogDesignAlways@(enable)beginvalid=1’b0;//dowritecycleaddr_lines=addr;data_lines=data;@(negedgeclk)beginvalid=1’b1;endendTopDownRefinedfromHDLLevelBottom-UpTransistorlevelBehavioralGateSwitchCircuitHigherlevelofabstractionVerilog-AasanextensionofSpiceAnalogSystemDescriptionandsimulationStructuralDescription•amoduleiscomprisedofotherchildmodulesBehavioralDescription•descriptionsinaprogrammaticfashionwiththeVerilog-Alanguage•ThemoduleisdefinedintermsofthevaluesforeachsignalMixed-levelDescriptions•CombinebothStructuralandBehavioralDescriptionsModemExamplemodemmodulatorchanneldemodulatorThemodemsystemismadeupof1)themodulator2)achannel3)thedemodulatorStructuralDescriptionhierarchyModule:qamInstance:modmodule:qam_modInstance:c1module:channelInstance:demodmodule:qam_demodStructuralDescriptionoftheModemSystem//VerilogAdefinitionofthemodemSystem`include“std.va”modulemodem(dout,din)’inoutdout,din;electricaldout,din;parameterrealfc=100.0e6;electricalclk,cin,cout;qam_mod#(.carrier_freq(fc))mod(cin,din,clk);channelc1(cout,cin);qam_demod#(.carrier_freq(fc))demod(dout,cout,clk);endmoduleStructuralDescriptionTypeofmoduleinstanceNameoftheinstancecreatedqam_mod#(.carrier_freq(fc))mod(cin,din,clk);Parameternameinchild(qam_mod)moduleassignedas:carrier_freq=fc16_QAMmodemExample2-bitd2aSerin_parout2-bitd2aaqAsin(2pifct+pi/4)didqaiAcos(2pifct+pi/4)dinmoutA(t)cos(2pifct+0(t))VerilogAmixedSignaldefinitionof16-QAMmodulatormoduleqam_mod(mout,din,clk);inoutmout,din,clk;electricalmout,din,clk;parameterrealfc=100.0e6;electricaldi1,di2,dq1,dq2;electricalai,aq;serin_paroutsipo(di1,di2,dq1,dq2,din,clk);d2ad2ai(ai,di1,di2,clk);d2ad2aq(aq,dq1,dq2,clk);realphase;VerilogAmixedSignaldefinitionof16-QAMmodulatoranalogbeginphase=2.0*`M_PI*fc*$realtime()+`M_PI_4;V(mout)+0.5*(V(ai)*cos(phase)+V(aq)*sin(phase));endendmoduleThebehavioraldefinitionoftheQAMmodulationisdefinedThesignalsaiandaqaretheoutputsofthe2-bitD/AconvertersTypeofanalogsystemsConservativeSystems•useofKirchoff’slaws•ElectricalSystemsuseKVLandKCL•AnyconservativeSystemuseKPLandKFL–appliedtobranchesSignalFlowSystems•onlypotentialisassociatedwitheverynode•unidirectional•notionofports(input/output)ConservativeSystemsDevice+-VInaconservativesystemthechargesorsignalscanenteraparticulardeviceinbothways.SignalFlowSystemsinOutAmplifierInsignalflowsystemsasignalcanonlyenteradeviceinonewayonly.WhatisSimulation?simulationisaprocessinwhichasystemofnonlinearordinarydifferentialequationsissolvedthisequationsarenotinputdirectly,butderivedfromeachofthemodelsthatareinterconnectedinthenetlistWhatitmeanstotheuser?Totheuserasimulationisessentiallyasoftwareversionofanoscilloscopeorlogicanalyzer.Asimulationisatechniquebywhichtheuseraskquestionsandreceivesanswersfromaprogram.Thequalityoftheanswersdependsonthequalityofthequestions.AnalogSystemSimulationTheStandardapproachtoanalogcircuitsimulationinvolves•formulatethedifferential-algebraicequationsforthecircuit•applyingimplicitintegrationmethodstothesequenceofnonlinearalgebraicequations•iterativemethodssuchasNewton-Raphsontoreducetoasetoflinearequations•usingsparsematrixtechniquestosolvethelinearequationsAnalogModelPropertiesTheVerilog-Alanguagecanbeusedtorepresentdifferenttypesofbehaviorstheseinclude•Linear•Nonlinear•Piecewiselinear•Integrodifferential•Event-drivenAnalogAnalogOperatorsTheVerilog-Alanguagedefinesanalogoperatorsfor•TimeDerivative•TimeIntegral•Lineartimedelay•Discretewaveformfilters•LaPlaceTransformfilters•Z-transformfiltersTimeDerivativeOperatorTheddtOperatorcomputesthetimederivativeofitsarguments•ddt(expression)InDCanalysistheddtoperatorreturnsazero.Applicationoftheddtoperatorresultsinazeroattheorigin.TimeIntegralOperatorTheidtoperatorcomputesthetimeintegralofitsarguments•idt(expression,ic,reset)WhenspecifiedwithinitialconditionstheidtoperatorreturnsthevalueoftheinitialconditioninDC.Withoutinitialconditions,idtmultipliesitsargumentbyinfinityinDCanalysis.TimeIntegralOperatorTheOptionalargumentRESETallowsresettingoftheintegratortotheinitialconditionorICvalue.Applicationoftheidtoperatorresultsinapoleattheorigin.DelayOperatorDelayoperatorimplementsatransportorlineartimedelayforcontinuouswaveforms•delay(expression,dt)TheparameterDTmustbepositiveTheeffectofthedelayoperatorinthetimedomainistoprovideadirecttimetranslationoftheinputTransitionOperatorThetransitionoperatorsmoothsoutpiece-wiseconstantwaveforms.Thetransitionfilterisusedtoimitatetransitionsanddelaysondiscretesignals•transition(expression,dt,tr,tf)Theinputexpressiontothetransitionoperatormustbedefinedintermsofdiscretestates.TransitionOperatorTheparametersdt,tr,tfareoptional•tr-transitionrise•tf-transitionfall•dt-changeintimeifdtisnotspecifiedthenitistakentobezeroifthevaluefortrisspecifiedthesimulatorwilluseitforboththeriseandfalltimes.TransitionOperatorWhenriseandfalltimesarelongerthanthespecifieddelay•ifthenewfinalvaluelevelisbelowthecurrentvaluethetransitionOperatorusestheolddest
本文标题:veriloga
链接地址:https://www.777doc.com/doc-1849460 .html