How to Use a Procedure in VHDL

  Рет қаралды 17,328

VHDLwhiz.com

VHDLwhiz.com

Күн бұрын

Learn how to use a procedure in VHDL to create cascade counters in a clock module.
The blog post for this video:
vhdlwhiz.com/u...
Procedures are a type of subprogram in VHDL that can be used instead of copy-pasting code. They are like mini-modules which can be invoked from a line of code within a clocked or concurrent process.
Unlike a function, which is the other type of subprogram in VHDL, a procedure doesn’t have a return value. Values can be returned from procedures through the parameter list though. The parameters can have any of the directions “in”, “out”, or “inout”, just like in a module can. The inputs may be signals, variable, or constants.
Another thing that separates procedures from modules is that procedures can contain wait-statements, while functions cannot. They can consume time. Because of this, procedures are often used in testbenches as bus-functional models (BFMs).
Procedures can be declared in the declarative region of the VHDL file, or the declarative region of a process, or they can be declared in a package.
*** Update:
The IncrementWrap procedure contains a bug that causes it to fail in newer versions of Questa/ModelSim that follow the VHDL standard more closely.
The Wrapped signal should be cleared outside of the If statement. See the updated version of the procedure in my blog post: vhdlwhiz.com/u...

Пікірлер: 17
@eliav3
@eliav3 5 жыл бұрын
you are so organized, accurate, and explain simply! thank you very much!
@edadan
@edadan 6 ай бұрын
I've been a Verilog coder since the early 90's and I'm new to VHDL...but, this just blew me away! Very elegant and efficient, but will take some time and practice to get used to this style.
@linek150
@linek150 3 жыл бұрын
Great video, do not stop recording! I learn a lot from your channel!
@VHDLwhiz
@VHDLwhiz 3 жыл бұрын
Thanks, Piotr. More is coming. 😀
@FPGA_Arabic
@FPGA_Arabic 10 ай бұрын
THIS IS COMPLETELY MAGNIFICENT 😵😵
@LuisSantiago-rp1gs
@LuisSantiago-rp1gs Жыл бұрын
Only one word ... Astonishing
@lorenzociacchini387
@lorenzociacchini387 10 ай бұрын
Chapeau and thank you a lot! :)
@DAURYENTUBE
@DAURYENTUBE 6 ай бұрын
Recommended procedure for performing laboratory work 1.develop a mathematical algorithm for solving the problem. 2.determine the required data types in the package. 3.study of differences in the design of functions and procedures in the VHDL language. 4.write the texts of functions and procedures. 5.write a test program. 6.Modeling and obtaining timelines. It is necessary to carry out testing of two functions and two procedures. task1. function (procedure) of double representation of the population presentation. This is a function (procedure) of the bit_vector type → INTEGER. Late (true) the rank of dual representation is assigned to the senior. The number of bits of the vector is equal to 8. task2. function (procedure) of preobrasovation of the first part of the presentation of the second part presentation. This is a function (procedure) of the integer type → BIT_VECTOR. First the rank of dual representation is assigned to the senior. The number of bits of the vector is equal to 8.
@saravanasubramanian
@saravanasubramanian 4 жыл бұрын
good to use "procedure"subprogram to reduce the code length,
@AhmadAsmndr
@AhmadAsmndr 2 жыл бұрын
Thanks a lot. You are amazing
@saravanasubramanian
@saravanasubramanian 4 жыл бұрын
Sir, what is the purpose of Tick and why do you check clockfreqHz -1
@BOND-oc2vi
@BOND-oc2vi 4 жыл бұрын
I believe Tick is what manages the time passed. Every time Tick = ClockFrequency, one second has passed. This in turn control the hours, minutes, and seconds.
@PL-VA
@PL-VA 5 жыл бұрын
For a software guys, this hurt watching. It's so hard to think sequence matters.
@WolfBrownie
@WolfBrownie Жыл бұрын
I had a slightly different Rev of the simulator. So I had to add Wrapped := false; in an else for the if Enable then in the procedure. It wasn't being cleared automatically. Like so: begin if Enable then if Counter = WrapValue - 1 then Wrapped := true; Counter
@VHDLwhiz
@VHDLwhiz Жыл бұрын
Actually, your new version of the simulator is correct. That was a bug in my code which I have corrected in the blog post: vhdlwhiz.com/using-procedure/ But I can't change the video. Great work fixing it yourself!
@amalsal9559
@amalsal9559 Жыл бұрын
Wow! This coding style is way too elegant for me 💔
@DAURYENTUBE
@DAURYENTUBE 6 ай бұрын
please help me
How to create a Finite-State Machine in VHDL
24:23
VHDLwhiz.com
Рет қаралды 56 М.
How to use the most common VHDL type: std_logic
10:05
VHDLwhiz.com
Рет қаралды 23 М.
This mother's baby is too unreliable.
00:13
FUNNY XIAOTING 666
Рет қаралды 41 МЛН
小蚂蚁会选到什么呢!#火影忍者 #佐助 #家庭
00:47
火影忍者一家
Рет қаралды 120 МЛН
DID A VAMPIRE BECOME A DOG FOR A HUMAN? 😳😳😳
00:56
How to use a Function in VHDL
8:55
VHDLwhiz.com
Рет қаралды 18 М.
How to create a Clocked Process in VHDL
11:08
VHDLwhiz.com
Рет қаралды 48 М.
How to use Signed and Unsigned in VHDL
9:41
VHDLwhiz.com
Рет қаралды 34 М.
How to create a timer in VHDL
11:44
VHDLwhiz.com
Рет қаралды 52 М.
9.10. Processes, transactions, & events
17:12
Electron Tube
Рет қаралды 2,8 М.
The Problem with Time & Timezones - Computerphile
10:13
Computerphile
Рет қаралды 4 МЛН
How to create a signal vector in VHDL: std_logic_vector
10:11
VHDLwhiz.com
Рет қаралды 38 М.
30 Programming Truths I know at 30 that I Wish I Knew at 20
17:41
How to use Port Map instantiation in VHDL
9:16
VHDLwhiz.com
Рет қаралды 48 М.
All Rust features explained
21:30
Let's Get Rusty
Рет қаралды 315 М.