Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[moved] VHDL AMS Simulation: hamster

Status
Not open for further replies.

Arushi Jain

Newbie
Newbie level 2
Joined
Oct 12, 2015
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
17
The following code results in the error under determined model and the simulation breaks off.
How should I remove the error. I have coded in Hamster Vhdl
Code:
library IEEE;        
use IEEE.MATH_REAL.ALL;                                                                                                          
LIBRARY DISCIPLINES;
USE DISCIPLINES.ELECTROMAGNETIC_SYSTEM.ALL;  
                           
entity equation is      
port( quantity x1,x2,x3,x4,x5 : in real; 
		quantity fx1,fx2,fx3,fx4,fx5 : out real);
end equation;        

architecture behav of equation is                                                                             
begin   
fx1 == x1**2.0 + 1.0; 
break;   
fx2 == x2**2.0 + 1.0; 
break;
fx3 == x3**2.0 + 1.0;
break;              
fx4 == x4**2.0 + 1.0;
break;                                                                              
fx5 == x5**2.0 + 1.0;
end behav;                               

--------------------------------------------------------------------------------------------------------------------------------------------------

library IEEE;        
use IEEE.MATH_REAL.ALL;                                                                                                          
LIBRARY DISCIPLINES;
USE DISCIPLINES.ELECTROMAGNETIC_SYSTEM.ALL;      
                                                                                                                                                           
entity TrapiRule is 
--generic (n:real);              -- number of intervals in which the function is to be divided.
port( 
quantity a: inout real;
quantity b :in real;
quantity w2,w3,w4,w5: out real);
end TrapiRule;                                                                                                                                                                                      

architecture behav of TrapiRule is
quantity h : real;   
--TYPE base IS ARRAY(0 to 5) of real;  
--quantity x: base;                                       
begin
h == (b-a)/5.0;                            
--procedural is
--begin
--for i in 1 to 5 loop 
--x(i) :=  a + (i-1)*h;  
--end loop;
                    
w2 == a + h;
break;
w3 == a + 2.0*h; 
break;
w4 == a + 3.0*h; 
break;
w5 == a + 4.0*h;
end architecture behav;

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

library IEEE;        
use IEEE.MATH_REAL.ALL;                                                                                                          
LIBRARY DISCIPLINES;
USE DISCIPLINES.ELECTROMAGNETIC_SYSTEM.ALL;  

entity DefTra is
port(quantity y1,y2,y3,y4,y5: in real;
	 quantity result : out real);
end DefTra;

architecture behav of DefTra is   
quantity res: real :=0.0;             
quantity h : real;
begin

res ==  y1/2.0 + y2 +y3 + y4 + y5/2.0 ;                     
end architecture behav;   

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------

library IEEE;        
use IEEE.MATH_REAL.ALL;                                                                                                          
LIBRARY DISCIPLINES;
USE DISCIPLINES.ELECTROMAGNETIC_SYSTEM.ALL;  
                                                    
entity testbench is 
port(
quantity final:out real);                            
end testbench;
                                                                                                                                                                                         
architecture behav of testbench is 
quantity a,b,result: real;
quantity f2,f3,f4,f5:real; 
quantity d1,d2,d3,d4,d5:real;    
quantity m: real; 
begin                                                                   
BREAK
a=>1.0, b=>6.0;
tr1: ENTITY trapiRule     (behav)             PORT MAP (a=>a, b=>b, w2=>f2, w3=>f3, w4=>f4 , w5=>f5 );   
eq1: ENTITY equation     (behav)              PORT MAP (x1=>a, x2=>f2 ,x3=>f3,x4=>f4, x5=>f5,fx1=> d1, fx2=>d2,fx3=>d3,fx4=>d4,fx5=>d5);
def1: ENTITY DefTra      (behav) 		      PORT MAP(y1=>d1,y2=>d2,y3=>d3,y4=>d4,y5=>d5, result=>result);
m== (b-a)/5.0;                            
final == result* m;
 end architecture behav;
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top