













Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
These are the Lecture Slides of CAD Based Logic Design which includes Divide and Conquer, Stitching Up, Computation, Design Problem, Leaf Subproblem, Carry-Lookahead Adder, Intricate Techniques, Fast Tree Designs, Associative Operations etc. Key important points are: Based Logic Design, Test Stimuli, Testbenches, File Definition, File Declaration, File Class, File Object, File Reading, Vhdl Implicitly, File Writing, Problem Description, Files in Subprograms
Typology: Slides
1 / 21
This page cannot be seen from the preview
Don't miss anything!














type file_type is file of element_type;
procedure read ( file f: file_type; value : out element_type; length : out natural); function endfile ( file f: file_type ) return boolean ;
p1: process is
type bit_vector_file is file of bit_vectors; file vectors: bit_vector_file open read_mode is “vec.dat”; variable next_vector : bit_vector (63 downto 0); variable actual_len: natural;
begin
while not endfile(vectors) loop read (vectors,next_vector,actual_len); if actual_len > next_vector’length then report “vector too long”; else for bit_index in 1 to actual_len loop …. end loop; end if; end loop; wait;
end process; Docsity.com
function read_array (file_name: string; len: natural) return integer_vector is type integer_file is file of integer; file data_file: integer_file open read_mode is file_name; variable result: integer_vector(1 to len); variable index: integer := 1; begin while not endfile(data_file) and index <= len loop read(data_file, result(index)); index:= index + 1; end loop; return result; end;
status_error: file object previously open and associated with a physical file.
name_error: in read mode indicates file does not exist. in write mode indicates file cannot be created. in append mode indicates both.
mode_error: indicates file cannot be opened in the specified mode.
procedure read_transform ( file f: transform_file;
variable transform : out transform_array) is
begin
for i in transform’range(1) loop for j in transform’range(2) loop if endfile(f) then report “unexpected end of file” severity error; return end if; read (f,transform(i,j)); end loop; end loop;
end;
are legitimate characters; if they need to be skipped, then that does need to be done explicitly at the point of the ws character w/ a read: read(L,c), where “c” is of type character.
readline(file_id,L); read (L,s); -- L is a string, s is a string read (L,s); read (L,bv); -- bv is a bit_vector read (L,i); -- i is an integer read (L,r); -- r is a real read (L,c); -- c is a character read (L,t); -- t is a time
procedure write (L : inout line; value: in bit; justified: in side := right; field: in width := 0); procedure write (L : inout line; value: in bit_vector; justified: in side := right; field: in width := 0); procedure write (L : inout line; value: in boolean; justified: in side := right; field: in width := 0); procedure write (L : inout line; value: in character; justified: in side := right; field: in width := 0); procedure write (L : inout line; value: in integer; justified: in side := right; field: in width := 0); procedure write (L : inout line; value: in real; justified: in side := right; field: in width := 0); procedure write (L : inout line; value: in string; justified: in side := right; field: in width := 0); procedure write (L : inout line; value: in time; justified: in side := right; field: in width; unit: in time:= ns);Docsity.com