The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Mar 28th, 2024, 4:29pm
Pages: 1
Send Topic Print
What ir the error while implementing the code on HAMSTER (Read 4172 times)
Ashish_Shavarna
New Member
*
Offline



Posts: 1

What ir the error while implementing the code on HAMSTER
Nov 12th, 2010, 4:10am
 
----------------------------------------------------------------------
SAW Device Package
----------------------------------------------------------------------                          
LIBRARY DISCIPLINES;
LIBRARY IEEE;

USE DISCIPLINES.ELECTROMAGNETIC_SYSTEM.ALL;
USE IEEE.MATH_REAL.ALL;

ENTITY SAW IS
   PORT(TERMINAL i,o : ELECTRICAL);--Interface ports.
END SAW;                                                                


ARCHITECTURE behav OF SAW IS
   QUANTITY v_in ACROSS i;
     QUANTITY v_out ACROSS i_out THROUGH o;
     QUANTITY Z,X,H,HT: REAL;

     CONSTANT F0: REAL := 225.571e6;
     CONSTANT Np: REAL := 226;
     CONSTANT Cs: REAL := 0.503385e-12;
     CONSTANT K: REAL :=0.04;              
BEGIN                    
                           
     X == 1.0e-12 when now=F0 else 3.14*Np*((now-F0)/F0);
     v_out == v_in*2.0*K*sqrt(Cs*F0)*Np*((sin (X))/X);
     Z == 2.0*K*sqrt(Cs*f0)*Np*(sin (1.0e-12)/(1.0e-12));
     HT == 20.0*log10(abs(v_out**2.0)/(z**2.0));                                                                                                            

END ARCHITECTURE behav;                                                                                                            


----------------------------------------------------------------------
-- The resistor definition begins.....
----------------------------------------------------------------------
-- Schematic of the resistor component:
--
--        p o----/\/\/\----o m
--
----------------------------------------------------------------------
LIBRARY DISCIPLINES;
USE DISCIPLINES.ELECTROMAGNETIC_SYSTEM.ALL;

ENTITY resistor IS
     GENERIC  (resistance    : REAL);            --resistance value given as a generic parameter.
   PORT     (TERMINAL p,m  : ELECTRICAL);      --Interface ports.
END resistor;

ARCHITECTURE behav OF resistor IS
   QUANTITY r_e ACROSS r_i THROUGH p TO m;
BEGIN                                              
   r_i == r_e/resistance;  -- The ohmic resistance equation.
END behav;
----------------------------------------------------------------
--Impulse Source
---------------------------------------------------------------                                                                    
LIBRARY DISCIPLINES;
LIBRARY IEEE;

USE DISCIPLINES.ELECTROMAGNETIC_SYSTEM.ALL;
USE IEEE.MATH_REAL.ALL;

ENTITY vsource IS  
   PORT(TERMINAL p,m: ELECTRICAL); --Interface ports.
END;

ARCHITECTURE behav OF source IS
     --quantity declarations.          
   QUANTITY v_in ACROSS i_in THROUGH p TO m;
BEGIN
     v_in == 1.0;
END;

                           

-----------------------------------------------------------------  
-- Test Bench

-- ==============================================================
     
LIBRARY DISCIPLINES;                            
USE DISCIPLINES.ELECTROMAGNETIC_SYSTEM.ALL;
                                                                 
ENTITY network IS
END;

ARCHITECTURE behav OF network IS              
     TERMINAL n1,n2,n3,n4,n5: ELECTRICAL;
BEGIN                                                                                                                                  
     VS          : ENTITY vsource    (behav)                    PORT MAP (n1, electrical_ground);
     SAW_device  : ENTITY SAW        (behav)                    PORT MAP (n2,n3);
     R1                : ENTITY Resistor   (behav) GENERIC MAP (50.0) PORT MAP (n1,n2);
     R2                : ENTITY Resistor   (behav) GENERIC MAP (50.0) PORT MAP (n3,electrical_ground);                                                                    
END;                  



I have this error " Unexpected Identifier : IDNETIFIER SAW"

Please help, otherwise i may lose my job!!
Back to top
 
 
View Profile   IP Logged
Pages: 1
Send Topic Print
Copyright 2002-2024 Designer’s Guide Consulting, Inc. Designer’s Guide® is a registered trademark of Designer’s Guide Consulting, Inc. All rights reserved. Send comments or questions to editor@designers-guide.org. Consider submitting a paper or model.