verilogd a virtuoso simvision

16
אוניברסיטת בן- אילן כתיבת קודVerilog וקודVerilogA (AMS) מה נלמד היום ? נלמד את עקרונות שפתverilog . נכתוב בשפה זו קוד התנהגותי למעגל "גוזר", ולמחלק תדר. נכתוב קוד ל- testbench ונריץ סימולציה בכליncverilog לקבלת האותות בזמן. נבנה מודול בוירטואוזו ונבנה לוtestbench בוורילוג לווריפיקציה. את הtestbench נייבא לוירטואוזו ונריץ את הסימולצייה. הסימולציה תייצר קובץ טקסט שמכיל את תוצאות הבדיקות שלנו ותאמר לנו אם המודול שלנו עובד כראוי. בנוסף, נלמד מה זהVerilog . נראה דוגמא ות פשוטות לקודVerilog A . נבנה מודול קטן בשפה זו ונייבא אותו לתוךvirtuoso לשימוש.

Upload: avrahamelka

Post on 22-Jun-2015

16 views

Category:

Documents


11 download

TRANSCRIPT

Page 1: VerilogD a Virtuoso SimVision

אילן-אוניברסיטת בן

VerilogA (AMS)וקוד Verilogכתיבת קוד

מה נלמד היום ?

נלמד את עקרונות שפתverilog.

.נכתוב בשפה זו קוד התנהגותי למעגל "גוזר", ולמחלק תדר

נכתוב קוד ל-testbench ונריץ סימולציה בכליncverilog .לקבלת האותות בזמן

נבנה מודול בוירטואוזו ונבנה לוtestbench בוורילוג לווריפיקציה. את הtestbench

נייבא לוירטואוזו ונריץ את הסימולצייה. הסימולציה תייצר קובץ טקסט שמכיל את

תוצאות הבדיקות שלנו ותאמר לנו אם המודול שלנו עובד כראוי.

בנוסף,

נלמד מה זהVerilog.

לקוד ות פשוטותנראה דוגמאVerilog A.

נבנה מודול קטן בשפה זו ונייבא אותו לתוךvirtuoso .לשימוש

Page 2: VerilogD a Virtuoso SimVision

אילן-אוניברסיטת בן

Verilogעקרונות שפת

נלמד את המבנה הבסיסי דרך דוגמא פשוטה.

מחלק תדר

למשל(. . ניתן לבנות רכיב זה בכמה דרכים )מכונת מצבים 4נבנה מחלק תדר פי נתחיל בקוד פשוט.

-(. המוצא שלנו יהיה למעשה ה ביטים ) 2אנחנו נבנה אותו על ידי שימוש במונה עם

MSB. :הקוד

נשים לב לעובדה שכל ההשמות כאן הן מסוגnonblocking assignments

נכתובtest-bench :עבור רכיב זה

(, cadence)חברת simvisionכעת, אנחנו רוצים להריץ את הקוד וורילוג שלנו. נעשה זאת בסימולטור

(.mentor graphicsשל modelsimניתן גם להשתמש בסימולטורים אחרים )למשל

// Discription: Frequency Divider by 4 module, with active low asynchronous reset.

// Writen by: Hadar Dagan

module freqDivider4(rst_n,clk,clkDivided);

// input and output signals

input rst_n, clk;

output reg clkDivided;

// internal signals

reg [1:0] counter;

// the code itself

always @(negedge rst_n or posedge clk)

if (!rst_n)

clkDivided<=#1 1'b0;

else

clkDivided<=#1 counter[1];

always @(negedge rst_n or posedge clk)

if (!rst_n)

counter<=#1 2'b00;

else

counter<=#1 counter+1'b1;

endmodule

// Discription: Test-Bench for the Frequency Divider by 4 module.

// Writen by: Hadar Dagan

module freqDivider4_tb; // signals

reg rst_n, clk;

wire clkDivided; // instanciation

freqDivider4 freqDivider4(.rst_n(rst_n), .clk(clk) , .clkDivided(clkDivided) ); // the code itself. generation of the clock

always

#5 clk=~clk;

initial begin

$shm_open("testbench.db",1); // Open waveform file

$shm_probe("AS"); // Dump all signals to file

clk=0;

rst_n=1’bx;

#1 // @t=1

rst_n=0;

#1 // @t=2

rst_n=1;

#198 // @t=200

$finish;

end

endmodule

Page 3: VerilogD a Virtuoso SimVision

אילן-אוניברסיטת בן

…module load EDIכעת,

module load "SimVision"

which irunניתן לבדוק אם זה נטען:

בתוך התיקיה שנמצא בה קובץ הוורילוג. irunהרצת הוורילוג ע"י שימוש בתוכנה מתבצע עם פקודת

irun filename.v –gui –access -rwc או irun mux_8bit.v –gui –access +rwc ה .–gui

לשם פתיחת ממשק ויזואלי.

מה שאנחנו בפועל רוצים זה לראות שהסימולציה מפיקה את צורות הגלים שדרשנו: חלון ה -

design browser היה אמור כבר לשים לכם את המודול בתוך לשונית סימולטור. בחלון

הימני רואים את הסיגנלים. ואז ניתן ללחוץ על המודול ואז על האייקון עם צורות הגלים

(. על inזה zoom out ,Iזה O. )לחיצה על play -לוחצים על אייקון הויפתח חלון הגלים. ואז

ידי כפתור ימני על הסיגנלים ניתן לעבור להציג את הערכים בבסיס שונה למשל עשרוני. כעת

אם לחצנו על סיגנל ואז על האייקון של החצים זה יעביר אותנו לשינוי הקודם או הבא

בסיגנל.

אות מה בניתם.ולר debugוכך אתם יכולים ל -

לא ישתנה אוטומטית עליכם ללכת waveformאם שיניתם משהו בקובץ וורילוג כמובן שה -

. reinvoke simulationללשונית

נצפה בגרפים המתקבלים:

המחלק עובד כראוי. ניתן לראות את האיפוס )של המונה( בתחילת הסימולציה.

Page 4: VerilogD a Virtuoso SimVision

אילן-אוניברסיטת בן

מעגל "גוזר"

active. גם מעגל זה יאופס על ידי לעומת המצב הקודם לוגי אם יש שינוי בכניסה 1שיעלה מעגל נתכנן

low reset נבנה דיאגרמת מצבים מסוג .Mealy:

אלה מוכרת מראיונות עבודה(, אבל נממש ש)זו XOR-ו DFFכמובן שניתן לממש מעגל זה על ידי

SM (State Machine.)אותו בצורה התנהגותית, על מנת ללמוד את סגנון הקוד של

RESET

STATE_0

STATE_1

Page 5: VerilogD a Virtuoso SimVision

אילן-אוניברסיטת בן

זו: SMנכתוב קוד וורילוג המממש

module derivModule(rst_n,clk,D,Z);

input rst_n, clk,D;

output reg Z;

parameter RESET =2'b00; // parameters

parameter STATE_0 =2'b10;

parameter STATE_1 =2'b11;

reg [1:0] curState, nextState; // internal signals

always @* // the combinatoric block of the state machine

case (curState)

RESET: begin

if (D) nextState=STATE_1;

else nextState=STATE_0;

end

STATE_0: begin

if (D) nextState=STATE_1;

else nextState=STATE_0;

end

STATE_1: begin

if (D) nextState=STATE_1;

else nextState=STATE_0;

end

default: nextState=RESET;

endcase

always @(posedge clk or negedge rst_n) // calculation of the current state

if (!rst_n) curState <= #1 RESET;

else curState <= #1 nextState;

// generation of the output

always @(posedge clk or negedge rst_n)

if (!rst_n) Z <= #1 1'b0;

else begin

if ( (nextState[0] && !curState[0]) || (!nextState[0] && curState[0]) )

Z <= #1 1'b1;

else

Z <= #1 1'b0;

end

endmodule

Page 6: VerilogD a Virtuoso SimVision

אילן-אוניברסיטת בן

לבדיקת הרכיב: TBוכמו קודם, נכתוב גם

ונקבל את הגרפים:

// Discription: Test-Bench for the derivative module.

// Writen by: Hadar Dagan

module derivModule_tb;

// signals

reg rst_n, clk, D;

wire Z;

// instanciation

derivModule derivModule(.rst_n(rst_n),.clk(clk),.D(D),.Z(Z));

// the code itself

// generation of the clock

always

#5 clk=~clk;

initial begin

$shm_open("testbench.db",1); // Open waveform file

$shm_probe("AS"); // Dump all signals to file

clk=1;

rst_n=1'bx;

D=1'bx;

#1 // @t=1

rst_n=0;

#1 // @t=2

rst_n=1;

#7 // @t=9

D=0;

#20 // @=t=29

D=1;

#30 // @=t=59

D=0;

#31 // @=t=90

$finish;

end

endmodule

Page 7: VerilogD a Virtuoso SimVision

אילן-אוניברסיטת בן

נשים לב שבקוד וורילוג, החלק הקומבינטורי ממומש ללא השהיות ובהשמות מסוגblocking

assignments.

ניתן לשלב בין המודולים שבנינו על ידי כתיבת מודול נוסף ו-instantiation של שני המודולים

וירטואוזו(.-בתוכו )כמו שאנחנו עושים בסכמטיק

Verification

test bench)בעבודה אתם צריכים לבנות פשוט לווריפיקציה של מודול שבנינו test benchאיך בונים

:כזה לזיכרון שבניתם(

כלומר דיגיטאלי ניתן להשתמש בוורילוג. אנחנו 'ים 0' -'ים וGND \ '1ו VDDאם הבלוק עובד עם ואז בונים את הוורילוג שיתחבר (8)בדוגמא בכיתה נבנה מוקס וירטואוזובבונים את המודול

. הקוד שלנו ייעורר את הכניסות בצורות לשם ווריפיקציה לארכיטקטורה הזו לכניסותיה ומוצאיהאת תוצאות הבדיקה "נשפוך" לתוך קובץ יות.ווקטורים ויקרא את המוצאים ויבדוק פונקציונל-גל

לדוגמא אם בנינו מוקס בוירטואוזו ואנחנו רוצים לבדוק אותו נבנה את הקוד הבא: טקסט`timescale 1ns/100ps //default, must be outsize a module

module MUX_8(S,A,OUT); //comment parameter delay=5; //

input OUT; //one bit input for testing the correctness of our virtuoso designed mux

output [2:0] S; //S is an output port of size 3. It is the mux's selector

output [7:0] A; //A is the mux's input vector of size 8

reg flag;

reg [2:0] S;//

reg [7:0] A;// integer i,j,out_file;//integer is 32 bit

initial //initial block - first round..

begin

out_file=$fopen("/u/engsegel/leviita2/Desktop/Projects/output_file.txt");//out_file is an "handle"

or procedure and not really a file. the real file is output_file.txt. they both can be of the same name

for (i=0;i<8;i=i+1)//by default previous files with the same name are deleted and re-writen. you

can add a"output_file.txt, a} or ap which means to append--> write at the end of the existing file

begin

S<=i;

flag<=1'b0;

for(j=0;j<256;j=j+1)

begin

A<=j;

#delay;

if (OUT!=A[i])

flag<=1'b1; //for example 8'hAB 8 bits of 10101011

end

if(flag) // chack was with error functionality..

$fdisplay(out_file,"A<%1d>\tFail",i);//write into the output_file the location in

decimal basis of A<> when we fail \t inserts a TAB before the FAIL statement

else //fdisplay automatically inserts a '\n', the i is the index of A<>

Page 8: VerilogD a Virtuoso SimVision

אילן-אוניברסיטת בן

$fdisplay(out_file,"A<%1d>\tPASS",i);

end

$fclose(out_file); // will only occure once

end

endmodule

, (cadence)חברת simvisionכעת, אנחנו רוצים להריץ את הקוד וורילוג שלנו. נעשה זאת בסימולטור .(mentor graphicsשל modelsim)למשל ניתן גם להשתמש בסימולטורים אחרים

ללכת לתיקייה שנמצא בה הוורילוג. ("module load SimVision )באופן כלליאצלנו באופן כללי הכלי עולה אוטומטית.

.which irunניתן לבדוק אם זה נטען: בתוך התיקיה שנמצא בה קובץ הוורילוג. irunהרצת הוורילוג ע"י שימוש בתוכנה מתבצע עם פקודת

irun filename.v –gui –access -rwc או irun mux_8bit.v –gui –access +rwc לשם פתיחת ממשק ויזואלי. gui–. ה r–מספיק גם רק

חלון ה מה שאנחנו בפועל רוצים זה לראות שהסימולציה מפיקה את צורות הגלים שדרשנו: -

design browser היה אמור כבר לשים לכם את המודול בתוך לשונית סימולטור. בחלון

הימני רואים את הסיגנלים. ואז ניתן ללחוץ על המודול ואז על האייקון עם צורות הגלים

על (.inזה zoom out ,Iזה O. )לחיצה על play -ואז לוחצים על אייקון ה ויפתח חלון הגלים.

תן לעבור להציג את הערכים בבסיס שונה למשל עשרוני. כעת ידי כפתור ימני על הסיגנלים ני

אם לחצנו על סיגנל ואז על האייקון של החצים זה יעביר אותנו לשינוי הקודם או הבא

בסיגנל.

ולראות מה בניתם. debugוכך אתם יכולים ל -

לא ישתנה אוטומטית עליכם ללכת waveformאם שיניתם משהו בקובץ וורילוג כמובן שה -

. reinvoke simulationללשונית

כעת שהכל עובד כשורה ובנינו את זה כראוי אנחנו רוצים לייבא זאת לוירטואוזו:

file ( ונכנסים ללשונית !library managerשל וירטואוזו )לא ב CIWפותחים את חלון ה -

import Verilog :

- Target Library Name - כעת אנחנו נשאלים לתוך איזו ספריה לעשותimport אז לעשות

לבדיקה. במקרה שלנו מוקס. designזאת לתוך התיקייה שיש בה את ה

- Verilog File To Import - לבחור את הקובץ וורילוג שלנו בחלון של הfile folder name

ובן גם כמה קבצים.)עדיף מראש לשים אותו במיקייה עם המוקס..(. ניתן להוסיף כמ

- Import Structural Module as :functional.

.Verilogיש לרשום Functionalים. היכן שרשום TABכמה -

- Functional – לרשוםverilog.

בלשונית השנייה. ובכל אנחנו לא משתמשים בפינים גלובליים ומי שמשתמש צריך לציין זאת -

.VDD2שרשום שם אז תשנו אותו. למשל ל אופן אם אתם משתמשים בשם הדיפולטי

Page 9: VerilogD a Virtuoso SimVision

אילן-אוניברסיטת בן

. שימו לב שנוצר גם library manager. כעת אתם יכולים להתבונן בקובץ ב OKלוחצים -

סימבול.

דגש חשוב אם כעת אתם רוצים לעשות שינויים בוורילוג ותעשו בקובץ המקורי דבר לא יקרה -

כים ללכת לקובץ המתאים כי קיידנס ברגע האימפורט יוצר עותק של הקובץ ולכן אתם צרי

מהקיידנס אך שימו לב שלקיידנס יש בתיקיית העבודה שלכם. אתם גם יכולים להריץ זאת

editor בחלון -רע מאוד לקבצי טקסט ולכןCIW אתם יכולים לרשוםeditor ואז זה ואנטר

שהוא לא כ"כ נוח. לשינוי תרשמו: VIזה default שב editorירשום לכם את שם ה

editor="gedit".

designונשים בתוכו את הסימבול של הוורילוג ואת ה mux_8_TBכעת ניצור קובץ סכמטיק -

עצמו. ספקים ונחווט.

)כמו configמסוג file new cellview -ו TBכפתור ימני על ה library managerכעת ב -

הסכמטיק למשל של בלוק לעבוד view-שרק אומר עם איזה תיאור זה קובץ pexשעשיתם ב

: USE TEMPLATEואז !!view schematicבוחרים וורילוג(. או PEX, עם PEXללא

!NAME - AMSולבחור ב

Verilogהאפשריים ואתם צריכים לוודא שה VIEWיש את כל ה view listשימו לב שב

על הטופס. schematic. OKוהשני מופיע ראשון

הקונפיג אתם רואים שמי שיש לו וורילוג הוא נבחר ומי שיש לו רק סכמטיק הוא כעת שנפתח

נבחר.

!. view configתבחרו designכאשר אתם בוחרים -test, להוסיף חדש ADEוניתן לפתוח -

test : Setup. בחלון של ה pathותעתיקו את ה model libraries אח"כ תלכו ללשונית של ה

Simulator ams ולכן תחזרו שוב ל את המודלים סמה שזה עושה זה מאפ ואזmodel

libraries ולבחור את בהעתקתם בצעד הקודם) הלינק למודלים בחזרה את תעתיקו לכאןו

ולאפשר netlist and run optionsואז בחלון של הסימולציה לבחור , אם יש צורך( -ttכל ה

OSS based simulation with irun יש שם אופציה(batch שז אומר כל הסימולציה במכה

יש .ואז כל פעם עושים מחזור של הסימולציה( interactive או אם הסימולציה כבדה ניתן

' לוגי, זמני עליה וכו'.. עושים זאת בלשונית 1עוד נקודה שצריך להגדיר לקובץ וורילוג מה זה '

setup connect rules ואז בחלונית .connect rules ללחוץ על browse ולבחור את

. ב V 1.8שה אומר ConRules18.vamsואז לבחור (שנתתי לכם) connect_Libתיקיית

connect rules כדי לראותם יש ללכת לתיקייה יש המון מודליםconnectLib ולפתוח ת

שמות לחלקים ואתם צריכים להעתיק את המתאים ולרשום ב הקובץ ואתם רואים שיש שם

rules name :ConnRules_18V_full_fast ואז ללחוץ .ADD ורק אזOK.

Page 10: VerilogD a Virtuoso SimVision

אילן-אוניברסיטת בן

שלא יהיה עליכם להגדיר הכל שוב מהתחלה. ורק אז SESSION-SAVE STATEתלחצו -

אין צורך ב liberalשניות ותבחרו 30uשימו לב כמה זמן ? ) וכו'... transientלהגדיר

conservative).....

להריץ סימולציה. -

.. אז נמצא אותו: הוא נמצא היכן שקיים קובץ הוורילוג fileמה שבאמת עניין אותנו זה ה -

)תיקיית העבודה (.

סימולטור שבחרתם שמריץ לכם את הסימולציה \שימו לב שכאשר אתם מריצים סימולציה הכלי

קובץ ומעדכן אותו.י כבר רושם את הamsעבור הבלוק ה

Verilog A (AMS in our more general case)

Verilog A הוא בעצם subset שלVerilog AMS כלומר, האחרון יכול להכיל בלוקים דיגיטאליים

זהה Aואנלוגיים בו זמנית בעוד שהראשון מנוון ללוגיקה אנאלוגית בלבד. הקוד והסינטקס בורילוג

לתחום זה. במקרה שלנו אנחנו Verilog AMSוהפונקציות וכו' הם סט מוגבל מתוך הכלל של

אז זה לא קריטי. AMSנשתמש בסימולטור

וד וורילוג שמתאר התנהגות בעצם זה ק A. קובץ וורילוג verilogAכעת נלמד לעבוד עם קבצי

. Verilog Analogת, אנלוגי

:דוגמאות, תוך כדי ראשית הגדרות

Before going into Verilog-A modeling examples, it is important to understand some of

the language basics. Verilog-A has the ability to model a variety of disciplines, the most

common of which are electrical, magnetic, thermal, kinematic, and rotational. You can

also define your own disciplines. For the most part, the electrical discipline, which is

expressed as voltages and currents, is used primarily for integrated circuit modeling.

Discipline electrical domain = electrical;

potential = Voltage;

flow = Current ;

enddiscipline

Page 11: VerilogD a Virtuoso SimVision

אילן-אוניברסיטת בן

Disciplines are described by Natures, which describe the tolerance (abstol), evaluated

units (units), and name (access). Usually, Disciplines and Natures are described in a file

called disciplines.h (disciplines.vams for Verilog-AMS) which is included during

netlisting.

Nature Voltage abstol = 1u ;

units = `V`;

access = V ;

huge = 1e5 ;

endnatur

The constants.h (constants.vams) file which carries commonly used mathematical and

physical constants is also included. Mathematical constants have an `M_ prefix and

physical constant `P_ prefix (examples: `M_TWO_PI = 2π and `P_Q = Q).

Verilog-A modules have pin connections (called ports) and behave like any component in

a circuit, such as a transistor or resistor. The syntax of the model file, outside of including

the disciplines.h and constant.h files, starts with a module declaration which carries the

module name and declared pin names. The pin connections have declared port directions

and disciplines. In IC design, the discipline will likely be electrical, but there are cases

where only a voltage or current will be used

`include "disciplines.vams"

`include "constants.vams"

module rlc (a,b);

electrical a,b;

parameter R=1 exclude 0;

parameter C=1;

parameter L=1 exclude 0;

branch (a,b) res, cap, ind;

analog begin

I(a,b) <+ idt(V(a,b))/L;

V(res) <+ R*I(res);

I(cap ) <+ C*ddt(V(cap));

end

endmodule;

The analog begin line is where analog behavior begins. Often, this section is where

voltage and currents from outside pins are sensed, checked for signal crossings,

mathematically conditioned, then pushed back out to the circuit or stored in a file . The equals sign (=) is used to equate relations evaluating a new value with each step of

the simulator. The simulator interprets the model in sequential steps. For example, at each

Page 12: VerilogD a Virtuoso SimVision

אילן-אוניברסיטת בן

timestep for a transient, each relationship is evaluated and can depend on previous lines.

Inside a controlled loop, such as conditional expressions, all expressions are evaluated together and dependent on outside the loop. The Contribution Operator (<+) is a line in

the model that passes conditioned signals back to the rest of the circuit being simulated.

This can be additive, such that there could be multiple expressions passing signals to the

same outside pin. All lines in the model file end with a ì;î except basically, begin, else

and end statements. The model file is closed with an endmodule statement.

Analog Operaors (some examples):

1. Differentiator: ddt(x)

- Time derivative of its argument

- For second derivative, use ! y = ddt(x), then z = ddt(y)

2. Integrator: idt(x)

- Time integral of its argument, with optional initial condition

Example: y = idt(x) + c;

3. Circular Integrator: idtmod(x) example

- Time integral of its argument, passed through a

modulus operation

- Periodic integration

Page 13: VerilogD a Virtuoso SimVision

אילן-אוניברסיטת בן

4. Time Delay: absdelay(x)

- Delayed argument

Example with Idtmod- Basic Sinusoidal VCO:

module vco(out,in);

voltage out,in;

parameter real k = 1M;

real phase, freq;

analog begin

freq = k*V(in);

phase = idtmod(freq,0,1);

V(out) <+ cos(2*`M_PI*phase);

$bound_step(1/(10*freq));

end

endmodule

Analog Event-Driven Modeling

1. @ (event)

- When an event edge is needed, an `@(event) command` is used to execute the

command. The following table describes the most common event commands that

can be used.

Analog Event Types Description

cross(expr,dir) At analog signal crossings

above(expr) At signal low-to-high crossing, and when above at DC

timer(time,dt) Periodically or at specific times

Initial_step At the beginning of simulation

final_step At the end of the simulation

2. Cross Event Operator

- Syntax: cross( expr, direction, timeTol, exprTol )

- Generates event when expr crosses 0 in a specified direction

- Timepoint is placed just after the crossing, within tolerances

- To know the exact time of crossing, use last_crossing( expr )

Page 14: VerilogD a Virtuoso SimVision

אילן-אוניברסיטת בן

This is a file you will find in literature many of those have bugs …. !!! There are many

false codes. Below you will find one that works and try to import and simulate it into

virtuoso!

module dff (q,d,clk);

voltage q, d, clk;

input clk, d;

output q;

parameter real td=0 from [0:inf], tr=0 from [0:inf];

parameter integer dir=1 from [-1:1] exclude 0;

parameter real Vdd=5 from (0:inf);

integer state;

analog begin

@cross(V(clk) – Vdd/2, dir)

state = (V(d) > Vdd/2);

V(q) <+ transition(state*Vdd,td,tr);

end

endmodule

A code that will work:

// VerilogA for IntroDigCircLab, DFF, veriloga

`include "constants.vams"

`include "disciplines.vams"

module dff (q,d,clk);

input clk, d;

output q;

electrical q, d, clk;

parameter real td=0 from [0:inf], tr=0 from [0:inf];

parameter integer dir=1 from [-1:1] exclude 0;

parameter real Vdd=1.8 from (0:inf);

integer state;

analog begin

@(initial_step)

V(q) <+ 0;

@(cross(V(clk)-Vdd/2, dir))

state=(V(d)>Vdd/2);

V(q) <+ state*Vdd;

end

Page 15: VerilogD a Virtuoso SimVision

אילן-אוניברסיטת בן

endmodule שימוש בתוך וירטואוזו:

FILENEWכל מה שיש לעשות לאחר בניית קוד כזה בכדי לייבא אותו לוירטואוזו זה

CELLVIEW VERILOG זאת בגלל שזה קוד כבר אנלוגי ולכן בשונה מהקוד הדיגיטאלי הוא לא

... הכל מוגדר בהתנהגות האנלוגית.'ה והירידה וכוילוגי או מהם זמני העלי 1צריך מידע על מה זה

ייפתח כתבן ויש לצרף לתוכו את הקוד. כאשר תשמרו ותסגרו יופיע חלון של יצירת סימבול וכמובן

ול לשם סימולציה. ומכאן ניתן לסמלץ.עליכם ליצור סימב

"שלד" למודול הקטנציק שאתם צריכים לבנות)כמובן שיש עוד אין סוף אופציות. תבחרו אחת...(:

// VerilogA for IntroDigCircLab, SA, veriloga

`include "constants.vams"

`include "disciplines.vams"

module SA(OUT, DGND, DVDD, BL, BLB, READ);

parameter real ????=????; //notes

……..

output ???;

electrical ???;

inout ???; //optional

electrical ???; //optional

input ???;

electrical ???;

.

.

.

analog begin

if (V(XXX)>XXX) begin

if (V(XXX , XXX)>XXX*V(XXX))

V(XXX) <+ XXX;

else if (V(XXX , XXX)>XXX*V(XXX))

V( XXX) <+ XXX;

else

V(XXX) <+ XXX;

end

else

Page 16: VerilogD a Virtuoso SimVision

אילן-אוניברסיטת בן

V(XXX) <+ XXX;

end

endmodule

שלכם וגם vaיהיו בתיקייה שבה יושב הקובץ vamsשימו לב שהקבצים המסתיימים ב .1 לשם גיבוי. workareaשל ה directoryב

.workareaשל ה directoryגם ב connect rulesעדיפות לשים את התיקייה של .2ומוקס בסיסי שמהם מרכיבים את ה nandמכיל אינברטר Lab4_Pracשימו לב שקובץ .3

MUX2to8bit .לשם גיבוי הקובץ שאיתו נעשה את התרגול על ווריפיקציה בוורילוגואוזו וכל השלבים המתוארים לעיל גם נמצא בתיקייה ווריפיקציה לאחר אימפורט לוירט

. MUX_8בשם לסיכום גם המעגל שמחבר את הוורילוג למודול של המוקס והסימולציה קיימים בתיקיית .4

MUX8_TB .

כל התיקייות האלו מוכנות שתשימו אותם בתוך תיקיית העבודה שלכם להרצה )אולי אתם .5 (.Library Path Editorצריכים להוסיף אותם ל