当前位置:网站首页>Using SystemVerilog to describe a state machine
Using SystemVerilog to describe a state machine
2022-06-22 05:52:00 【Silly boy: CPU】
Use Systemverilog Description state machine
The state of the system must be stored in internal registers . stay SystemVerilog In language , States can be enumerated (enumerated type) Express . Possible values of this type are state names , Variables are listed after a list of possible values . for example :
enum{s0,s1,..} state;
In the following code , There are two process blocks . Each process block is marked with its own name . The first one is marked with SEO The process block of describes a state machine . The process block waits for the arrival of the positive jump edge of the clock , Or wait for the arrival of the negative jump edge of the reset signal . The first test is the asynchronous reset signal , If the negative jump edge of the reset signal arrives , The default value is G Assigned to the state variable state. otherwise , Jump to case Statement branch , Enter different branches according to the current status value . therefore ,case Each branch of a statement is equivalent to a graph 6.9 One of the two states in and the judgment box . In the first branch , Test if a car is coming (car It's true / false ), Then set the State . If no car comes (car=0), The state remains unchanged ( That is still G). Declare the procedure block as always_ff block , It is therefore expected that this state will be mapped to one or more triggers triggered by a positive jump edge . Other states are constructed in a similar way .
The second one is marked with OP In the process block of , The output is set to 1. The process block is a corresponding to combinatorial logic always_comb block . Note that at the beginning of the process block, it is start_timer And other outputs 0. This example is a good practice , Because this writing can ensure that the latch will not be generated due to the negligence of code writing . Use again in the process block case sentence , This structure is related to ASM Figure corresponds to . In each state , Assign a value to the unconditional output ; The conditional assignment follows if After conditional statement .
module traffic_1 (
output logic start_timer,major_green,mintor_green,
input logic clock,n_reset,timed,car边栏推荐
- Vscode minimalist installation tutorial
- 数据的存储(进阶)
- From "platform transformation" to "DTC brand going to sea", what is the trend of 2021?
- 我不建议你工作太拼命
- Facing the bonus period of Google traffic, how do independent station sellers take advantage of the situation to market?
- 使用SystemVerilog门模型描述的组合逻辑
- Tensorflow 2.x(keras)源码详解之第十四章:keras中的回调及自定义回调
- Analysis of 43 cases of MATLAB neural network: Chapter 29 research on the application of limit learning machine in regression fitting and classification -- Comparative Experiment
- Unity 加密ASE 游戏数据
- Tensorflow 2. Chapter 14: callbacks and custom callbacks in keras
猜你喜欢

我不建议你工作太拼命

Record some problems and solutions encountered in processing SIF data

SCM future employment development direction, learn SCM must know some entry-level knowledge and industry prospects, read the benefit

Facebook账户 “ 解封、防封、养号 ” 知识要点,已收藏!

触 发 器

數據的存儲(進階)

爬虫初始及项目

线性回归:最小二乘、泰尔森估计、RANSAC

机器学习笔记 八:Octave实现神经网络的手写数字识别

大厂晋升学习方法四:Play 学习法
随机推荐
Analysis on the development status of China's copper aluminum composite bus industry and Research Report on investment opportunities 2022-2027
Adaboost
Academic circle of cattle II (daily question 49 in spring)
BinaryFormatter 保存和加载游戏数据 For Unity
基于CRU中的tmp数据进行年平均气温分析
服务器php相关网页开发环境搭建
Amazon and independent station are not simply two choices
open source hypervisor
MinGW下载安装
机器学习笔记 七:强大的神经网络表述
Golang Viper库入门教学
Clion installation Download
自控原理之系统辨识
MySQL basic interview questions
Mobile terminal layout adaptation
Grabcut analysis
Introduction to golang Viper Library
\[\e]0; \[email protected]\h: \w\a\]\[\033[01;32m\]\[email protected]\h\[\033[
n个整数的无序数组,找到每个元素后面比它大的第一个数,要求时间复杂度为O(N)
做事方法:3C 方案设计法