Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
17f361ea12 | ||
|
|
730cc895b1 | ||
|
|
019dc2868e | ||
|
|
b30efd039d | ||
|
|
ecd6f16dbe | ||
|
|
6a72019f25 | ||
|
|
53868c67fd | ||
|
|
6ab278694e | ||
|
|
026899b930 | ||
|
|
9ffb72cf97 | ||
|
|
72c964475f | ||
|
|
d2aa8277c7 | ||
|
|
c93bdaf629 | ||
|
|
1be3ce1cea | ||
|
|
4b0451fc63 | ||
|
|
20f8e707bd | ||
|
|
c46a1c3b33 | ||
|
|
6b874ba5c7 | ||
|
|
200a989683 | ||
|
|
613bffbcfc | ||
|
|
b8d834144b |
No files matched your search
@@ -9,7 +9,6 @@ interface Bus_if (input clk);
|
|||||||
logic[9:0] Data;
|
logic[9:0] Data;
|
||||||
logic SendData;
|
logic SendData;
|
||||||
logic TimerMeas;
|
logic TimerMeas;
|
||||||
logic Clk;
|
|
||||||
logic DataValid;
|
logic DataValid;
|
||||||
logic AlarmAmpel;
|
logic AlarmAmpel;
|
||||||
logic TasteAktiv;
|
logic TasteAktiv;
|
||||||
@@ -19,4 +18,28 @@ interface Bus_if (input clk);
|
|||||||
logic ReadTemp;
|
logic ReadTemp;
|
||||||
logic LEDg;
|
logic LEDg;
|
||||||
logic LEDr;
|
logic LEDr;
|
||||||
|
|
||||||
|
modport Fsm (
|
||||||
|
input clk,
|
||||||
|
input AlarmAmpel,
|
||||||
|
input DataValid,
|
||||||
|
input TasteAktiv,
|
||||||
|
output Alarm_R,
|
||||||
|
output SendData,
|
||||||
|
output TimerEN
|
||||||
|
);
|
||||||
|
|
||||||
|
modport timer (
|
||||||
|
input clk,
|
||||||
|
input Taste,
|
||||||
|
input TimerEN,
|
||||||
|
output ReadTemp,
|
||||||
|
output TasteAktiv
|
||||||
|
);
|
||||||
|
|
||||||
|
/*
|
||||||
|
module parallelport wird in top level design
|
||||||
|
ohne modport verbunden, da inEndOfConv nicht
|
||||||
|
Teil des Bus_if ist.
|
||||||
|
*/
|
||||||
endinterface //Bus
|
endinterface //Bus
|
||||||
@@ -3,8 +3,6 @@ input wire clk12M,
|
|||||||
input wire rst,
|
input wire rst,
|
||||||
input wire [7:0] data_input,
|
input wire [7:0] data_input,
|
||||||
input wire data_valid,
|
input wire data_valid,
|
||||||
output reg REDn,
|
|
||||||
output reg GRNn,
|
|
||||||
output reg RED,
|
output reg RED,
|
||||||
output reg GRN,
|
output reg GRN,
|
||||||
output reg alarm
|
output reg alarm
|
||||||
@@ -12,7 +10,8 @@ output reg alarm
|
|||||||
|
|
||||||
wire red_pwm;
|
wire red_pwm;
|
||||||
wire grn_pwm;
|
wire grn_pwm;
|
||||||
|
reg REDn;
|
||||||
|
reg GRNn;
|
||||||
defparam U1.on_hi = 2'b10;
|
defparam U1.on_hi = 2'b10;
|
||||||
defparam U1.on_lo = 2'b01;
|
defparam U1.on_lo = 2'b01;
|
||||||
defparam U1.off = 2'b00;
|
defparam U1.off = 2'b00;
|
||||||
|
|||||||
@@ -0,0 +1,57 @@
|
|||||||
|
`include "../spi_interface.v"
|
||||||
|
`include "../fsm/Fsm.sv"
|
||||||
|
`include "../Bus_if/Bus_if.sv"
|
||||||
|
`include "../timer_port/timer_top.sv"
|
||||||
|
|
||||||
|
module Top(
|
||||||
|
input wire clk,
|
||||||
|
input wire rst,
|
||||||
|
input wire endOfConv,
|
||||||
|
output wire LEDg,
|
||||||
|
output wire LEDr,
|
||||||
|
output wire AlarmAmpel
|
||||||
|
);
|
||||||
|
// Bus (Interface)
|
||||||
|
Bus_if bus(.clk(clk));
|
||||||
|
// SPI Interface
|
||||||
|
// FSM
|
||||||
|
Fsm fsm(
|
||||||
|
.clk(clk),
|
||||||
|
.inAlarmAmpel(bus.AlarmAmpel),
|
||||||
|
.inDataValid(bus.DataValid),
|
||||||
|
.inTasteAktiv(bus.TasteAktiv),
|
||||||
|
.outAlarm_R(bus.Alarm_R),
|
||||||
|
.outSendData(bus.SendData),
|
||||||
|
.outTimerEN(bus.TimerEN)
|
||||||
|
);
|
||||||
|
// Parallelport
|
||||||
|
parallelport parallelport1 (
|
||||||
|
.inClk(clk),
|
||||||
|
.inTimerMeas(bus.TimerMeas),
|
||||||
|
.inEndOfConv(endOfConv),
|
||||||
|
.inData(bus.Data),
|
||||||
|
.outDataValid(bus.DataValid),
|
||||||
|
.outData(bus.Data)
|
||||||
|
);
|
||||||
|
// FRAM-Controller
|
||||||
|
// Timer
|
||||||
|
timer timer1 (
|
||||||
|
.inClk(clk),
|
||||||
|
.inTaste(bus.Taste),
|
||||||
|
.inEN(bus.TimerEN),
|
||||||
|
.outReadTemp(bus.ReadTemp),
|
||||||
|
.outTasteAktiv(bus.TasteAktiv)
|
||||||
|
);
|
||||||
|
// Ampelsteuerung
|
||||||
|
led_top ampelsteuerung (
|
||||||
|
.clk12M(clk),
|
||||||
|
.rst(rst),
|
||||||
|
.data_input(bus.Data),
|
||||||
|
.data_valid(bus.DataValid),
|
||||||
|
.RED(LEDr),
|
||||||
|
.GRN(LEDg),
|
||||||
|
.alarm(bus.AlarmAmpel)
|
||||||
|
);
|
||||||
|
|
||||||
|
assign AlarmAmpel = bus.AlarmAmpel;
|
||||||
|
endmodule
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
`include "Top.sv"
|
||||||
|
|
||||||
|
module tb_Top;
|
||||||
|
|
||||||
|
endmodule
|
||||||
|
After Width: | Height: | Size: 69 KiB |
|
After Width: | Height: | Size: 71 KiB |
|
After Width: | Height: | Size: 82 KiB |
|
After Width: | Height: | Size: 85 KiB |
|
After Width: | Height: | Size: 85 KiB |
|
After Width: | Height: | Size: 67 KiB |
|
After Width: | Height: | Size: 80 KiB |
|
After Width: | Height: | Size: 73 KiB |
@@ -5,6 +5,45 @@
|
|||||||
Soft IP Version: 1.0.0
|
Soft IP Version: 1.0.0
|
||||||
2022 05 31 12:27:15
|
2022 05 31 12:27:15
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
SPI Interface Ports
|
||||||
|
trying to follow instructions from:
|
||||||
|
https://www.chipverify.com/systemverilog/systemverilog-interface
|
||||||
|
*******************************************************************************/
|
||||||
|
interface spi_interface_ports (input clk);
|
||||||
|
// Connection to BUS side (internal)
|
||||||
|
// Inputs from BUS
|
||||||
|
logic sb_clk_i; // Clock
|
||||||
|
logic sb_stb_i; // Chip Select from FRAM-Controller who is SPI-Master
|
||||||
|
logic sb_wr_i; // Write/Read from FRAM-Controller
|
||||||
|
logic sb_adr_i[7:0]; // Adddress from FRAM-Controller
|
||||||
|
logic sb_dat_i[7:0]; // Data in from FRAM-Controller
|
||||||
|
// Outputs to BUS
|
||||||
|
logic sb_dat_o[7:0]; // Data out to FRAM-Controller
|
||||||
|
logic sb_ack_o; // ACK to FRAM-Controller
|
||||||
|
|
||||||
|
// Connection to SPI side (external)
|
||||||
|
logic spi1_mosi_io; // MasterOutSlaveIn --> Master to Slave
|
||||||
|
logic spi1_miso_io; // MasterInSlaveOut --> Slave to Master
|
||||||
|
logic spi1_mcs_n_o[3:0]; // MasterChipSelect --> Master selects Slave
|
||||||
|
logic spi1_sck_io; // Clock for SPI-Slave
|
||||||
|
|
||||||
|
// MODPORT form BUS perspective (internal)
|
||||||
|
// modport output from BUS (internal)
|
||||||
|
modport BUS (output sb_clk_i, sb_stb_i, sb_wr_i, sb_adr_i[7:0], sb_dat_i[7:0], spi1_miso_io);
|
||||||
|
// modport input to BUS (internal)
|
||||||
|
modport BUS (input sb_dat_o[7:0], sb_ack_o, spi1_mosi_io, spi1_mcs_n_o[3:0], spi_sck_io);
|
||||||
|
|
||||||
|
// MODPORT from SPI perspective (external)
|
||||||
|
// modport output from SPI (external)
|
||||||
|
modport SPI (output spi1_miso_io);
|
||||||
|
// modport input to SPI (external)
|
||||||
|
modport SPI (input spi1_mosi_io, spi1_mcs_n_o[3:0], spi_sck_io);
|
||||||
|
|
||||||
|
endinterface
|
||||||
|
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
Wrapper Module generated per user settings.
|
Wrapper Module generated per user settings.
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||