Skip to content

Commit

Permalink
Changed from the original code to support altera model sim
Browse files Browse the repository at this point in the history
  • Loading branch information
Jehandad Khan committed Jun 2, 2015
1 parent 6485a35 commit 70fc779
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
23 changes: 14 additions & 9 deletions pcap/pcapparser_1gb.v
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,22 @@ module PcapParser
) (
input CLOCK,
input pause,
output available,
output datavalid,
output [7:0] data,
output [7:0] pktcount,
output newpkt,
output pcapfinished
output reg available,
output reg datavalid,
output reg [7:0] data,
output reg [7:0] pktcount,
output reg newpkt,
output reg pcapfinished
);

// regs
reg available = 0;
/* reg available = 0;
reg datavalid = 0;
reg [7:0] pktcount = 0; // line up with Wireshark GUI
reg [7:0] data = 0;
reg pcapfinished = 0;
reg newpkt = 0;

*/
// buffers for message
reg [7:0] global_header [0:23];
reg [7:0] packet_header [0:15];
Expand All @@ -48,7 +48,12 @@ module PcapParser
integer countIPG = 0;

initial begin

available = 0;
datavalid = 0;
pktcount = 0;
data = 0;
pcapfinished = 0;
newpkt = 0;
// open pcap file
if (pcap_filename == "none") begin
$display("pcap filename parameter not set");
Expand Down
8 changes: 4 additions & 4 deletions pcap/pcapparser_1gb_test.v
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module PcapParser_test;

// Inputs
reg CLOCK = 0;
reg paused = 1;
reg paused = 0; // 1;
wire available;
wire [7:0] pktcount;
wire streamvalid;
Expand All @@ -32,7 +32,7 @@ module PcapParser_test;
);

always #10 CLOCK = ~CLOCK;
always #100 paused = ~paused;
//always #100 paused = ~paused;

integer i;

Expand All @@ -48,13 +48,13 @@ module PcapParser_test;
#100;

// Add stimulus here
while (~pcapfinished ) begin
while (1) begin //~pcapfinished ) begin
// $display("stream: %8d %x %d %x %x %c", i, paused, pktcount, streamvalid, stream, stream);
#20
i = i+1;
end

$finish;
//$finish;

end

Expand Down

0 comments on commit 70fc779

Please sign in to comment.