The Designer's Guide Community Forum
https://designers-guide.org/forum/YaBB.pl Design Languages >> Verilog-AMS >> Help with test bench https://designers-guide.org/forum/YaBB.pl?num=1183386330 Message started by slackjack on Jul 2nd, 2007, 7:25am |
Title: Help with test bench Post by slackjack on Jul 2nd, 2007, 7:25am Hey all, I'm currently learning verilog. I'm trying to make a test bench to simulate a binary-to-7-segment decoder. I've broken the circuitry up into individual logic circuits for each segment (a-g); so I have 7 logic circuits total. I want to see how each of these individual logic circuit would respond to a series of identical waveforms. So instead of making separate verilog files for each of the logic circuits, I decided to dump them all in a test bench. But in doing so, I've made some mistakes and cant figure out what they are. I'm not concerned (ATM) with whether the logic circuits are functionally correct, right now I want to get the test bench up and running. Please help. Thanks :) Code:
P.S. Remember that I'm new to the world of verilog, so if you have any suggestions on how to do this in a more efficient way, please do tell. |
Title: Re: Help with test bench Post by slackjack on Jul 5th, 2007, 7:41am No comments on this guys? |
Title: Re: Help with test bench Post by boe on Jul 6th, 2007, 4:55am Hi slackjack, 1. Verilog is case sensitive, so you can't mix BinaryToCSeg and binaryToCSeg (etc). 2. the binaryToXSeg's have their output as lat port, but in the instantiation you give the output first. BOE. |
Title: Re: Help with test bench Post by Geoffrey_Coram on Jul 6th, 2007, 5:04am Quote:
It looks to me like you've swapped your inputs and outputs. That is, the module declarations always have the output last, but the instantiation lines always have w5 as the last port connection, meaning all the segments are fighting to set the value on w5. I think you need: binaryToASeg a(w2,w3,w4,w5, w1[6]); etc. |
Title: Re: Help with test bench Post by slackjack on Jul 6th, 2007, 6:35am Thank you both for your responses. I've changed my code as per your suggestions. Code:
However, when I compile this (on VeriLogger Pro) and still get error messages: Code:
|
Title: Re: Help with test bench Post by boe on Jul 6th, 2007, 6:49am And in module binaryToASeg you should schange bo to b0. BOE |
Title: Re: Help with test bench Post by slackjack on Jul 6th, 2007, 6:53am Hi Boe, That didn't do the trick either. Does it have something to do with how I made module Func_gen_and_disp? |
Title: Re: Help with test bench Post by boe on Jul 6th, 2007, 7:03am I tried it with the attached code. And the simulation runs... Code:
|
Title: Re: Help with test bench Post by slackjack on Jul 6th, 2007, 7:11am Thats weird. Are you using modelsim to run this? |
Title: Re: Help with test bench Post by boe on Jul 6th, 2007, 7:18am No, ncsim. Perhaps you should try old syntax: Code:
Code:
|
Title: Re: Help with test bench Post by slackjack on Jul 6th, 2007, 7:49am Old syntax yields nothing. Code:
I'll have to try this on Icarus Verilog or modelsim. This is beginning to prove very frustrating and is confusing me even more about the language. |
Title: Re: Help with test bench Post by slackjack on Jul 6th, 2007, 8:02am I've just confirmed that veriLogger pro doesnt use verilog 2001 style syntax. |
Title: Re: Help with test bench Post by boe on Jul 6th, 2007, 8:27am Hi slackjack, I noticed you have Seg in the port list but aSeg in the output statement... BOE Code:
|
Title: Re: Help with test bench Post by slackjack on Jul 6th, 2007, 9:00am I made the changes. Does this look alright, becuase it still doesnt compile: Code:
Thanks! Update: I managed to get my hands on an edition of verilogger thats supports 2001 syntax, and it compiles fine. But I'm still curious as to why the old one doesnt work. |
Title: Re: Help with test bench Post by boe on Jul 6th, 2007, 9:53am I can't see why you should need Verilog-2001 for your last piece of code (reply #13)... What error messages do you get? BOE |
Title: Re: Help with test bench Post by Geoffrey_Coram on Jul 9th, 2007, 6:30am In several of the segments, you have intermediate results, eg binaryToBSeg has p1 and p2. Do you need to provide some sort of declaration for them? |
Title: Re: Help with test bench Post by boe on Jul 9th, 2007, 7:36am Geoffrey_Coram wrote on Jul 9th, 2007, 6:30am:
I haven't checked the Verilog standard, though... BOE |
The Designer's Guide Community Forum » Powered by YaBB 2.2.2! YaBB © 2000-2008. All Rights Reserved. |