加入VIP
  • 专属下载特权
  • 现金文档折扣购买
  • VIP免费专区
  • 千万文档免费下载

上传资料

关闭

关闭

关闭

封号提示

内容

首页 vhdl语言教程

vhdl语言教程.pdf

vhdl语言教程

凤翼天翔
2012-01-11 0人阅读 举报 0 0 暂无简介

简介:本文档为《vhdl语言教程pdf》,可适用于IT/计算机领域

ßtN¼�ÿo€Ú(�U����������HW����HYDQ#PER�FLF�HGX�WZKWWS���ZZZ�FLF�HGX�WZ�aHYDQðӃrlCICDesignFlowlVHDLSyntaxlSynthesisConstrainslFrequencyUsedDesignslVHDLSystemSimulator(VSS)lLABExciseVHDL:DaylIntroductionlCICDesignFlowlVHDL–Basic–DataTypesOperators–StructuralModelinglBasicConceptsofVSSVHDL:DaylVHDLSyntax–SequentialStatements–ConcurrentStatementslDesignRecommendationslFrequencyUsedCircuitsModelingVHDLvsVerilogVHDLvsVerilog'HULORJRPSLODWLRQCompileinterpretativeLEUDULHVYesNoHVXDELOLWPackage`includeHDGDELOLWADACADA(DVWRHDUQLessintuitiveEASYVHDLvsVeriloglUSAIBM,TI,ATT,INTEL…lUSASiliconValleylEuropelJapanlKorealTaiwanVHDLAdvantageslCleardefinitionofdesignrequirementslEfficiencyindesigncycletimelFlexibilityinadaptingtodesignchangeslReuseofdesignsandpackageslTechnologyindependentlEasyanalysisofvariousarchitectureimplementationsVHDLAdvantageslDesignverificationandautoregressiontestslVHDLisrecommendedforgovernmentcontractslVHDLcommercialmodelsareavailableforpurchaselVHDLisadocumentationlanguagelVHDLisasimulationlanguageVHDLHistoryl–TheUSADepartmentofDefense(DOD)–projectundertheVeryHighSpeedIntegratedCircuit(VHSIC)VHDLHistoryl–IBM,TexasInstrumentsandIntermetrics–TheDODmandatedthatalldigitalelectroniccircuitsbedescribedinVHDL–IEEEstandardlTheFadvancedtacticalfighteraircraftFRaptorlNÉOYFlV�f�YFlmhighpitchtoomuchandcrashform,canrepairl>>>(ÙO„±llrhf�lY«³wFRaptorlCommonIntegratedProcessors,CIPlèurÇlك¢žlMemoryMBl„éÓ¤–p=s”–!IaÇﲔ²êlLanguageADAFADFfromDIDhttp:wwwdidcomVHDLHistoryl–IEEE'l–BothcommercialsimulationandsynthesistoolsbecameavailableadheringtoIEEE'standard–AVHDLpackageforusewithsynthesistools,IEEE–IEEE(VITAL)VHDLHistorylVHDLAMSCICVHDLDesignFlow×ÉÅÍÓÕÍÍæ÷æí×ÔÔÅæôêèïÄðîñêíæó×ÉÅÍÈâõæÍæ÷æí×ÔÔÄðîñâôô×ÉÅÍÈâõæÍæ÷æíîðåæí×æóêíðèÏæõíêôõÐñöô×æóêíðèÊïÐñöôÔäéæîâõêälEntity–blockIOportuÑlArchitecture–blockƒ=�”–ñu´˜‡!lConfiguration–¬s÷!architectureo�lPackagelPackagebodyVHDLvUHArch(version)Arch(version)Entity#HEntityHQWLWNANDLVSRUW�A,B:instdlogicZ:outstdlogic��HQGnand$'�ABZIODirectionlINlOUTlINOUTlBUFFERpleasedon’tusethisIODirectionlBufferlINOUTBasicDataTypelBitlBITVECTOR(TO)lSTDLOGIClSTDLOGICVECTOR(DOWNTO)DUFKLWHFWXUHSTRUCTRINANDLVsignalI:stdlogicEHJLQU�andSRUWPDS(A,B,I)U�indSRUWPDS(I,Z)HQGSTRUCT¼B¶Q#HNANDarchitecture#ABZIUUAnd(and)Inverter(ind)NANDNANDarchitecture#DUFKLWHFWXUHDATAFLOWRINANDLVEHJLQZ<=AnandBconcurrentstatementHQGDATAFLOW�NANDarchitecture#DUFKLWHFWXUHRTLRINANDLVEHJLQprocess(A,B)beginif(A='')and(B='')thensequentialstatementZ<=''elseZ<=''endifendprocessHQGRTL#HConfigurationFRQILJXUDWLRQcfgnandRINANDLVIRURTLHQGIRU�HQGcfgnandABZRTLRecall(QWLWa,('a�$,((bIa,(*,('b�),*$,c)a,)b(')�('c�#�•vHPackagelPackageDeclarationslPackageBodiesConstantDeclarationsTypeDeclarationsComponentDeclarationsSubprogramsSDFNDJHEXAMPLELVtypeBYTEisrangetosubtypeNIBBLEisBYTErangetoconstantBYTEFF:BYTE:=signalADDEND:NIBBLEcomponentBYTEADDERport(A,B:inBYTEC:outBYTEOVERFLOW:outBOOLEAN)endcomponentfunctionMYFUNCTION(A:inBYTE)returnBYTEHQGEXAMPLEPackageRecallPACKAGEaISENDaPACKAGEBODYaISENDa†úšDesignLibrarieslPrimaryUnit–EntityDeclaration–PackageDeclaration–ConfigurationDelcarationlSecondaryUnits–PackageBody–ArchitectureBodyDesignLibrarieslWorkingLibrary–writablelibrary(WORK)lResourceLibrary–vendor<�(synopsys,viewlogic)–Qlibrary(IEEE)–CelllibraryVHDLmodel(Compass)UsingPackageOLEUDUIEEEXVHIEEEstdlogicALLXVHIEEEstdlogicarithALLXVHIEEEstdlogicunsignedALLXVHIEEEstdlogicsignedALL��LEUDU:�XVH:EXAMPLEALLHQWLW���DUFKLWHFWXUH���Dàdatatypeà`signala:bitsignala:bitvector(downto)libraryIEEEuseieeestdlogicall…signala:stdlogicsignala:stdlogicvector(to)useieeestdlogicarithall…signala:signed(downto)signala:unsigned(downto)VHDLSystemSimulator(VSS)lsynopsysvsssetup:!POLEPOLE�a�YKGOFRPSDVV!FE��KS���Gcbhpd:$SYNOPSYSCompassVHDLModelcbhpdcbhpdmax:$SYNOPSYSCompassVHDLModelcbhpdmaxcbhpdtyp:$SYNOPSYSCompassVHDLModelcbhpdtypcbhpdmin:$SYNOPSYSCompassVHDLModelcbhpdmincbhdd:$SYNOPSYSCompassVHDLModelcbhddcbhddmax:$SYNOPSYSCompassVHDLModelcbhddmaxcbhddtyp:$SYNOPSYSCompassVHDLModelcbhddtypcbhddmin:$SYNOPSYSCompassVHDLModelcbhddmincbiodtyp:$SYNOPSYSCompassVHDLModelcbiodtypWLPHEDVHQV,(B(B)$����LEUDU,(((�XVHLHHH�VWGBORJLFB�����DOO�OLEUDUFE��KS���G�XVHFE��KS���G�FRPSRQHQWV�DOO�DUFKLWHFWXUHSTRUCTRINANDLVsignalI:stdlogicEHJLQU�andSRUWPDS(A,B,I)U�indSRUWPDS(I,Z)HQGSTRUCTURALNANDarchitecture#ABZIUUAnd(and)Inverter(ind)NANDVSSVHDLSimulator�VLP�R�D�FFRPSLOHUOLQNHUYKGOVLPYKGODQ�F�'VSSVHDLSimulatorlCompile(SynopsysVSS)–vhdlan°®—±lvhdlannandvhdl–gvan°×±lgvannandvhdlFilesinDesignLibraryrwrrevanDec:NANDmrarwrrevanDec:NANDsimrwrrevanDec:NANDARCHsimrwrrevanDec:TESTsimEntityQDQG�is…architectureDUFKofnandis…configurationWHVWofnandisMakefilelMultiVHDLfileslHierarchyDesign–simdependsoMakefilecfgnand–make–makeANALYZER=gvanVSSVHDLSimulatorlvhdldbxconfigurationarchitectureöG†±hierarchybrowserÓ¤éBôèàAàô�×A`VSSVHDLSimulatorlHierarchyBrowsertracesignalsPortsSignalsVariablesDesignÌVSSVHDLSimulator�néBô›Æ|VSSVHDLSimulatorladdcommandA�ח�阨VSSVHDLSimulatortracenandanandbnandzassign''nandaassign''nandbrunassign''nandaassign''nandbrunassign''nandaassign''nandbrunassign''nandaassign''nandbrun¨"enandincResultdcshell>includenandincùà�MBCîQ õꝃr��LABarchitecturearchofmultiisbeginprocess(a,b)begin�DE�endprocessendarchconfigurationtestofmultiisforarchendforendtestOLEUDULHHH�XVHLHHH�VWGBORJLFBDULWK�DOO�entitymultiisport(a,b:inXQVLJQHG(downto)z:outXQVLJQHG(downto))endmultiDataTypesScalarlEnumerations ±¤<(stdulogic,('U','X','','','Z','W','L','H','')<(Bit,('','')<(Boolean,(FALSE,TRUE)ScalarlEnumerationpredefinedcharacterbitbooleanseveritylevelScalelstdlogicLEUDU,(((�(,(((�VWGBORJLFB�����$�$,(($RI,VLJQDOD�'B*,�VLJQDOE�'B*,B(��GRZQWR���EHJLQE��D�D�D�D��HQGDUFK�LEUDULHHH�VHLHHH�VWGBORJLFBDULWK�DOO�DUFKLWHFWXUHDUFKRILVVLJQDOD�XQVLJQHG��GRZQWR���VLJQDOE�VLJQHG��GRZQWR���EHJLQD�´����µ�����E�´����µ�����HQGDUFK�ScalelstdlogicarithScaleLEUDULHHH�XVHLHHH�VWGBORJLFBDULWK�DOO�XVHLHHH�VWGBORJLFB�����DOO�$UFKLWHFWXUHDUFKRILVVLJQDOD�E�F�XQVLJQHG��GRZQWR���VLJQDO���VWGBORJLFBYHFWRU��GRZQWR���EHJLQF�D�E������"""""HQGDUFK�ScalarlPhysicals ”¾âït,onlyuseinsimulationTYPETimeISRANGEtoUNITSfsps=fsns=psus=nsENDUNITSžG¤îScalelPhysicalTypeTYPEcapacitanceisrangetounitsffdpf=ffdnf=pfuf=nfendunitsScalarlPhysicalpredefinedTimeScalelNumericTypeTYPEByteISRANGETOTYPERegisterISRANGE##TO##<base>#<value>#e<value>)(##)(=×=EScalelNumericTypepredefinedintegerreal<(Colors,(red,yellow,blue,green,black)<(Primary,Colors$*(redtoblue<(Integer,RANGETO<(Natural,Integer$*(TOInteger'HIGHSubtypesforEnumerationforNumericDÍFSMstatePredefinedAttributeslTypeRelated–T’base²·OHIW²·ULJKW²·KLJK²·ORZSubtypeslSubtypepredefined–Natural–PositiveTakeaBreakCompositelRecordTypeDFNDJHHDPSOHLVWSH)ORDWRLQWSHLVUHFRUGLJQ�VWGBORJLF�(SRQHQW�XQVLJQHG��GRZQWR���)UDFWLRQ�XQVLJQHG���GRZQWR���HQGUHFRUG�HQG�signexponenetfractionCompositelRecordTypeVHZRUN�HDPSOH�DOO�$UFKLWHFWXUHDUFKRILVVLJQDOD�)ORDWRLQWSH�EHJLQD�VLJQ�¶�·�D�HSRQHQW�´�������µ�D�IUDFWLRQ��RWKHUV!¶�·��HQGDUFK�CompositelRecordvsArray$UFKLWHFWXUHDUFKRILVVLJQDOD�VWGBORJLFBYHFWRU���GRZQWR���EHJLQD�����¶�·�D���GRZQWR����´�������µ�D���GRZQWR����RWKHUV!¶�·��HQGDUFK�CompositelArrayTypes (inpackage)–constrained–unconstrained<(String,$$<�Positive$*(�!�)Character<(BitVector,$$<�Natural$*(�!�)Bit<(DataBusLV$$<�TO�)Bit<(dim,$$<�TO,TO�)BitCompositelArrayType�–constrained–unconstrainedLJQDOF�String��GRZQWR���VLJQDOG�BitVector��GRZQWR���LJQDOD�DataBusVLJQDOE�dimObejctsåEåEcObjectslSignalÙ:signaldata:stdlogic:=‘’{s�:data<=‘’lConstanttoenhancereadabilityÙ:constantbitwidth:stdlogicvector(downto):=“”lVariableÙ:variabledata:unsigned(to):=“”{s�:data:=“”lFileTextiopackageTEXTIO(VWG�WHWLR�$�),(inputfile:(,,"dskvhdlindata"),(outputfile:(,"dskvhdloutdata"VARIABLEl,l:LINEVARIABLEtest:bitvector(DOWNTO)WHILENOT(ENDFILE(inputfile))LOOPREADLINE(inputfile,l)READ(l,test)WRITE(l,test)WRITELINE(outputfile,l)ENDLOOPTEXT(File)LINEBITdataTEXTIOMemoryInitPROCEDURErominit(VARIABLEromdef:INTEXTVARIABLEromdout:OUTmemdata)IS$,$(O�OLQH�BEGINlp:WHILENOT(ENDFILE(romdef))LOOPlp:FORjINromdout'RANGELOOPREADLINE(romdef,l)READ(l,romdout(j))ENDLOOPlpENDLOOPlpENDrominitTYPEmemdataISARRAY(integerRANGE<>)OFintegerromdout’RangeromdefPredefinedAttributeslTypeRelated–T’base²·OHIW²·ULJKW²·KLJK²·ORZPredefinedAttributeslArrayRelated–A’left–A’right–A’high–A’low²$·UDQJH²$·UHYHUVHBUDQJH²$·OHQJWK«perandslLiteralOperandslIdentifierlAggregatelFuncationcalloperandslIndexandSlice(ARRAY)lQualifiedExpressionOperandslTypeConversionOperandslRecordRecordElementOperandsOperandslLiteralOperands“ABC”B””X”FDE”TRUEFALSE‘a’‘’‘’###FDE#StringLiteralsEnumerationLiteralsNumericLiteralsDà�ArchitecturearchofenisSignalk:bitvector(downto)signalg:stdlogicvector(downto)begink<=X“FDE”g<=X“FDE”errorJ�WRBVWGORJLFYHFWRU�µ�)'(µ��endarchOperandslIdentifierSRUW�$���'�LQVWGBORJLF�<��<��RXWVWGBORJLF��IXQFWLRQ$�$�XQVLJQHG��GRZQWR���UHWXUQVWGBORJLFLVYDULDEOHHVXOW�VWGBORJLF�EHJLQ����HQG$�OperandslAggregate–Array–Record(a,b,a,d)(=>a,=>b,=>a,=>d)(‘’,“”,“”)(sign=>’’,exp=>””,frac=>””)OperandslAggregate#–Arraysignala,b:stdlogicsignalc:stdlogicvector(downto)signaly,y:unsigned(downto)signalya,yb,yc,yd:stdlogicy<=('','',AnorB,AnandB)y<=(=>AorB,=>AandB,=>'',others=>'')(ya,yb,yc,yd)<=notcbacyyyOperandslAggregate#–recordtypettisrecordsign:stdlogicexp:unsigned(to)endrecordsignalmix:ttmix<=(sign=>'',exp=>"")signexpOperandslAggregate(=>,=>,=>)<=ARorAR<=(=>,=>,=>)Æ!GVarray¨recordŒÂ”�šOperandslAggregatesignala:stdlogicsignalb:stdlogicvector(downto)signalc:stdlogicvector(downto)…��D�E�Q„�šOperandslFuncationcalloperands<��)Q��D��D��D��D��RUE�RUE��<���RUE�RU)Q��)�!$��)�!$��)�!$��)�!$���<���RU)Q��$��$��)�!$��)�!$��RU��OperandslIndexandSlice(ARRAY)��GRZQWR���D��WR�������D���DQGE������GRZQWR����D���DQGE�����D���RUE�������GRZQWR���E��GRZQWR������GRZQWR���F�OperandslQualifiedExpressionOperandsWSHB�LVUDQJH�WR���WSHB�LVUDQJH�WR���IXQFWLRQ)�$�B��UHWXUQ,�IXQFWLRQ)�$�B��UHWXUQ,�)������DPELJXRXV)�B��������XQDPELJXRXVtypename’(expression)¬Ðšunsigned’(“”)UÍsigned’(“”)OperandslTypeConversionOperands–intergertypes–similararraytypeslsamelengthlconvertibleoridenticalelementtypes–Enumeratedtypesarenotconvertibletypename(expression)OperandstypeINTisrangetosignalSINT:INTsignalTINT:INTTINT<=INT(SINT)OKSINT<=INT(TINT)errortypeINTisrangetolTypeConversionOperands°žGÀ±OperandslTypeConversionOperands°ÄhÀ±signalSBITVEC:MYBITVECTORBITARRAY(SBITVEC)OKtypeBITARRAYisarray(to)ofBITsubtypeMYBITVECTORisBITVECTOR(to)typeINTisrangetotypeARRAYisarray(to)ofINTsubtypeMYBITVECTORisBITVECTOR(to)typeBITARRAYisarray(to)ofBITsignalSBITVEC:MYBITVECTORsignalSBIT:BITOperandsBOOLEAN(SBIT)enumeratedtypeINT(SBIT)BITARRAY(SBITVEC)lengthnotequalARRAY(SBITVEC)elementtypesnotconvertiblelTypeConversionOperandsQ„�DšOperandslRecordRecordElementOperandsVLJQDO���BSH�VLJQDO<��BSH����LI��WKHQ<�,��,��,�HOVH<�,���HQGLI�OperatorslLogicaloperator(andornandnorxorxnor)lrelationaloperator(==<<=>>=)lshiftoperator(sllsrlslasrarolror)laddingoperator()lsign()lmultiplyingoperator(*modrem)lmiscellaneousoperator(**absnot)Operatorslconcatenatesignala,b:bitsignalc:bitvector(downto)c(downto)<=abOperatorslConcatenateOperator¬S)èà"unconstrainedArrayCaseabisERRORwhen“”=>Q<=Cwhen“”=>Q<=Awhenothers=>Q<=‘’endcaseOperatorsCasebitvector’(a,b)iswhen“”=>Q<=Cwhen“”=>Q<=Awhenothers=>Q<=‘’endcaseSubtypeTTTisbitvector(to)CaseTTT’(ab)iswhen“”=>Q<=Cwhen“”=>Q<=Awhenothers=>Q<=‘’endcaseOperatorslNandvsandZ<=aandbandcZ<=anandbnandcOperatorslforsynthesis–*ýh™žG�,lh"ìšG–È�týhÈDGÊaGOperatorsProcess(A)beginif((A<=“”)and(A>=“”))thenComparatorsQ<=‘’elseQ<=‘’endifendprocessProcess(A)SimpleLogicbeginif((A(downto)=“”)and(A(downto)=“”)and(A(downto)=“”))thenQ<=‘’elseQ<=‘’endifendprocessOperatorslREMSignofremoperationissignofthe“left”operandlMODSignofremoperationissignofthe“right”operand('������������������������J=K*N(JmodK)IEEEPackagespoperatorslIEEEstdlogicALLlIEEEstdlogicarithALLlIEEEstdlogicunsignedALLlIEEEstdlogicsignedALLlIEEEmathrealALLlIEEEmathcomplexALLunsignedstdlogicvectorÙٗ$G$Gs OperatorsFunctionsinPackagesLIBRARYIEEEUSEIEEESTDLOGICARITHALLvariableu:unsigned(downto)variables:signed(downto)variablecount:unsigned(downto)u:=“”s:=“”count:=convunsigned(arg=>,size=>)shl(u,count)shl(s,count)shr(u,count)shr(s,count)“”“”“”“”“”OnlineHelpManualVSSFamilyPackagesManualVSSUser’sGuide(V)HDLCompilerReferenceManualcpusrsynopsysiviewIview~iviewOnlineDocumentLEUDU,(((�XVHLHHH�VWGBORJLFB�����DOO�OLEUDUFE��KS���G�XVHFE��KS���G�FRPSRQHQWV�DOO�entitynandisport(a,b:instdlogicz:outstdlogic)endnandDUFKLWHFWXUHSTRUCTRINANDLVsignalI:stdlogicEHJLQU�andSRUWPDS(A,B,I)U�indSRUWPDS(I,Z)HQGSTRUCTStructuralModelingNetlistABZIUUAnd(and)Inverter(ind)NANDAssociationListslNamedAssociationboththeformalandactualsarelistedformal=>actuallPositionalAssociationonlytheactualsLEUDU,(((�XVHLHHH�VWGBORJLFB�����DOO�OLEUDUFE��KS���G�XVHFE��KS���G�FRPSRQHQWV�DOO�entitynandisport(a,b:instdlogicz:outstdlogic)endnandDUFKLWHFWXUHSTRUCTRINANDLVsignalI:stdlogicEHJLQU�andSRUWPDS(a=>A,a=>B,zn=>I)U�indSRUWPDS(I=>I,zn=>Z)HQGSTRUCTStructuralModelingNetlist(I)ABZIUUAnd(and)Inverter(ind)NANDw†´›DUFKLWHFWXUHSTRUCTRINANDLVsignalI:stdlogicsignalGND:stdlogicsignalVCC:stdlogicEHJLQU�andSRUWPDS(a=>VCC,a=>GND,zn=>I)U�indSRUWPDS(I=>I,zn=>OPEN)HQGSTRUCTStructuralModelingNetlist(I)Portmap(a=>’’,a=>’’,zn=>I)VHDL’onlyStructuralModelingNetlist(II)entitymyandisport(A,B:instdlogicC:outstdlogic)endmyandarchitecturearchofmyandisbeginc<=aandbendarchconfigurationcfgandofmyandisforarchendforendcfgandMyandbacStructuralModelingNetlist(II)entitymyinvisport(a:instdlogicz:outstdlogic)endmyinvarchitecturearchofmyandisbeginz<

用户评价(0)

关闭

新课改视野下建构高中语文教学实验成果报告(32KB)

抱歉,积分不足下载失败,请稍后再试!

提示

试读已结束,如需要继续阅读或者下载,敬请购买!

文档小程序码

使用微信“扫一扫”扫码寻找文档

1

打开微信

2

扫描小程序码

3

发布寻找信息

4

等待寻找结果

我知道了
评分:

/49

vhdl语言教程

仅供在线阅读

VIP

在线
客服

免费
邮箱

爱问共享资料服务号

扫描关注领取更多福利