Entity: cyc_to_led

  • File: cyc_to_led.v

Diagram

Generics

Generic name Type Value Description
MD_SIM_ABLE 0 sim mode enable
WD_LED_LIGHT 27 LED light span wdith
WD_LED_NUMB 3 led width to true LED
WD_ERR_INFO 4 error info note

Ports

Port name Direction Type Description
i_sys_clk input system signals
i_sys_resetn input
i_cyc_trig_led input [WD_LED_NUMB-1:0] trig signal
o_port_driv_led output [WD_LED_NUMB-1:0] led port
m_err_cyc_info1 output [WD_ERR_INFO-1:0] error info feedback

Signals

Name Type Description
r_cyc_trig_led reg [WD_LED_NUMB-1:0] cycle signal temp one clock
w_cyc_trig_led_pos wire [WD_LED_NUMB-1:0] detect cycle signal pos edge
r_led_light_cnt reg [WD_LED_LIGHT-1:0] counter for every LED driver

Processes

  • unnamed: ( @(posedge i_sys_clk) )

    • Type: always

`timescale 1ns / 1ps

/*

Src Code

*/
// *******************************************************************************
// Company: Fpga Publish
// Engineer: FP
//
// Create Date: 2024/01/09 22:54:18
// Design Name:
// Module Name: cyc_to_led
// Project Name:
// Target Devices: ZYNQ7010 | XCZU2CG | Kintex7
// Tool Versions: 2021.1 || 2022.2
// Description:
// *
// Dependencies:
// *
// Revision: 0.01
// Revision 0.01 - File Created
// Additional Comments:
//
// ******************************************************************************* module cyc_to_led #(
//mode
parameter MD_SIM_ABLE = 0, //!sim mode enable
//number
parameter WD_LED_LIGHT = 27, //!LED light span wdith
parameter WD_LED_NUMB = 3, //!led width to true LED
//width
parameter WD_ERR_INFO = 4 //!error info note
)(
//!system signals
input i_sys_clk ,
input i_sys_resetn,
//!trig signal
input [WD_LED_NUMB-1:0] i_cyc_trig_led,
//!led port
output [WD_LED_NUMB-1:0] o_port_driv_led, //!error info feedback
output [WD_ERR_INFO-1:0] m_err_cyc_info1
);
//========================================================
//function to math and logic //========================================================
//localparam to converation and calculate //========================================================
//register and wire to time sequence and combine
// ----------------------------------------------------------
// src signal solve
reg [WD_LED_NUMB-1:0] r_cyc_trig_led; //!cycle signal temp one clock
wire [WD_LED_NUMB-1:0] w_cyc_trig_led_pos;//!detect cycle signal pos edge // ----------------------------------------------------------
// led cnt
reg [WD_LED_LIGHT-1:0] r_led_light_cnt [0:WD_LED_NUMB-1]; //!counter for every LED driver //========================================================
//always and assign to drive logic and connect
// ----------------------------------------------------------
// src signal solve
always@(posedge i_sys_clk)
begin
if(!i_sys_resetn) //system reset
begin
r_cyc_trig_led <= 1'b0; //
end
else if(1) //
begin
r_cyc_trig_led <= i_cyc_trig_led; //
end
end
assign w_cyc_trig_led_pos = i_cyc_trig_led & (~r_cyc_trig_led);
// ----------------------------------------------------------
// led cnt
generate genvar i;
for(i = 0; i < WD_LED_NUMB; i = i + 1)
begin:FOR_WD_LED_NUMB
always@(posedge i_sys_clk)
begin
if(!i_sys_resetn) //system reset
begin
r_led_light_cnt[i] <= 1'b0; //
end
else if(w_cyc_trig_led_pos[i]) //every trig will reset counter
begin
r_led_light_cnt[i] <= 1'b0; //
end
else if(r_led_light_cnt[i][WD_LED_LIGHT-1])
begin
r_led_light_cnt[i] <= r_led_light_cnt[i];
end
else
begin
r_led_light_cnt[i] <= r_led_light_cnt[i] + 1'b1;
end
end
assign o_port_driv_led[i] = r_led_light_cnt[i][WD_LED_LIGHT-1];
end
endgenerate //========================================================
//module and task to build part of system //========================================================
//expand and plug-in part with version //========================================================
//ila and vio to debug and monitor endmodule /*

补充说明(UTF-8)

  • 基于LED监测周期信号
  • 主要用于监测周期在ms级别的中断等物理信号
  • 本模块暂时进行到源码设计阶段

*/

随机推荐

  1. Seata的分布式事务实现原理

    Seata分布式事务方案 简介 Seata是阿里开源的分布式事务解决方案中间件,对业务侵入小,在应用中Seata整体事务逻辑基于两阶段提交的模型,核心概念包含三个角色: TM:事务发起者.用来告诉TC ...

  2. Execl常用快捷操作

    常用的操作 Ctrl+A 全选 Ctrl+Z 撤销 Ctrl+X 剪切 Ctrl+C 复制 Ctrl+V 粘贴 Ctrl+B 加粗 Ctrl+S 保存 Ctrl+F 查找 Ctrl+H 替换 Alt+ ...

  3. Vue 上传前获取图片宽度尺寸和大小

    参考资料:https://www.cnblogs.com/wyx-remove-love/p/wyx-20190626-1.html    https://blog.csdn.net/qq_22771 ...

  4. 1.Go 的基本数据类型

    Go 的基本数据类型

  5. 新来个架构师,用48张图把OpenFeign原理讲的炉火纯青~~

    大家好,我是三友~~ 在很久之前,我写过两篇关于OpenFeign和Ribbon这两个SpringCloud核心组件架构原理的文章 但是说实话,从我现在的角度来看,这两篇文章的结构和内容其实还可以更加 ...

  6. VC-MFC 在磁盘中读取文件

    1 // ReadDlg.cpp : 实现文件 2 // 3 4 #include "stdafx.h" 5 #include "Read.h" 6 #incl ...

  7. Python回顾面向对象

    [一]面向过程开发和面向对象开发 [1]面向过程包括函数和面条 包括面条版本一条线从头穿到尾 学习函数后开始对程序进行分模块,分功能开发 学习模块化开发,我们就可以对我们的功能进行分类开发 建一个功能 ...

  8. hire 聘用 受雇 租金 单词记忆

    hire 基本解释 vt. 聘用:录用:雇用:租用 vi. 受雇:得到工作 n. 租金:酬金,工钱:[非正式用语] 被雇佣的人:销售部的两个新雇员 来自Proto-Germanic*hurjan,租, ...

  9. 英语自定义标签 <i:juzi><i:zhuyu>John Smith</i:zhuyu></i:juzi> 主语谓语宾语

    效果 John Smith died in World War Two. John Smith killed three enemy soldiers. <style> i\:juzi { ...

  10. http-server -S 开启 https 服务

    下载 openssl Win64 OpenSSL v1.1.1k Light http://slproweb.com/download/Win64OpenSSL_Light-1_1_1k.exe 一路 ...