About ISIM simulator and Test Bench with verilog, output .txt to Matlab
Software : ISE 14.3
Simulator : ISim by xilinx.
I am a beginner to learn the verilog and FPGA.
I want to use FPGA to process image. After processing, I require to read the processed data into Matlab for matching the results .
I have stored 256*256,8bit image into the ROM.
This is my module.
module image_top
input clka,
input ena,
input rst_n,
output [7:0] douta,
output reg rd_stop
reg[15:0]addra;
always@(posedge clka or negedge rst_n)
begin
if(!rst_n)
addra <= 0;
else if(ena)
addra <= addra + 1;
else
addra <= addra;
end
wire rd_stop_flag;
assign rd_stop_flag = (addra == 65535-1)?1:0;
//reg rd_stop;
always@(posedge clka or negedge rst_n)
begin
if(!rst_n)
rd_stop <= 0;
else if(rd_stop_flag)
rd_stop <= 1;
else
rd_stop <= rd_stop;
end
ImageMem u_imgemem
.clka (clka), // input clka
.ena (ena&&!rd_stop), // input ena
.addra (addra), // input [15 : 0] addra
.douta (douta) // output [7 : 0] douta
endmodule
This is my TestBench. I am not sure this is correct.
`timescale 1ns / 1ps
// Company:
// Engineer:
module TB_top;
// Inputs
reg clka;
reg ena;
reg rst_n;
// Outputs
wire [7:0] douta;
wire rd_stop;
// Instantiate the Unit Under Test (UUT)
image_top uut
.clka(clka),
.ena(ena),
.rst_n(rst_n),
.douta(douta),
.rd_stop(rd_stop)
integer fp_w,j;
initial
begin
// Initialize Inputs
clka = 0;
ena = 0;
rst_n = 0;
fp_w = $fopen("image_out.txt","w");
// Wait 100 ns for global reset to finish
#100 rst_n =1;
#20 ena = 1;
// Add stimulus here
for(j = 0; j < 65536; j= j+1)
begin
$fwrite(fp_w,"%d\n",douta);
end
$fclose(fp_w);
end
always #5 clka = ~clka;
endmodule
This is my TestBench.
After synthesis, In the project,there is a' image_out.txt' file,but the datas in it are all zero.
I wonder what is the problem?
This is my simulation waveform by ISIM.
I wonder if ISIM isn't good to support ''for-loop" or system command like $fwrite?
If true, I have to install the modelsim simulator.
Thank you for your reply!
The bug is in your testbench.
Inside the for loop, you haven't given any opportunity for time to advance. So, the entire 64K iterations of the loop happen "instantaneously" at the same moment in time. This means that there have been no clock periods inside the loop - you are effectively writing the same output of your design (which is 0) 64K times. Advancing time is necessary since your address counter only changes state once per clock period; so all the fwrite's of dout are getting the data from the same address location.
At very least you need to put an "@(posedge clk)" or at least a #10 inside your for loop to allow time to progress (so that you get the output of the module on different clock periods).
Avrum
Similar Messages
-
How to create a matrix with constant values and multiply it with the output of adc
How to create a matrix with constant values and multiply it with the output of adc
nitinkajay wrote:
How to create a matrix with constant values and multiply it with the output of adc
Place array constant on diagram, drag a double to it, r-click "add dimension". There, a constant 2D double array, a matrix.
/Y
LabVIEW 8.2 - 2014
"Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
G# - Free award winning reference based OOP for LV -
Simulation and Testing my results
The attached file is supposed to receive 3 signals from the microcontroller via serial communication in the format
sig1sig2sig3
Is there a way I could simulate and test the file without connecting it to the hardware???
Attachments:
UpdatedDisplay.vi 83 KBHey Lynn
Thanks for your response.
I did understand what you are trying to say but that only enables me to do the test once
If you notice my file, I have to read the following format in a while loop
sig1sig2sig3
I am trying to find a way whereby i can simulate multiple reads.
Also, I want to channel all the incoming data via "serial read" so as to demonstrate the whole file working as a whole entity (for my presentation)
I am quite aware that there is a "random number generator" and "read from spreadsheet" that could help me accomplish this.
But i just cant figure out the whole logic. -
Basic questions about word spacing and vertical alignment with CSS
I'm sill very new to Dreamweaver and web page designing. I've
read the entire manual SC3, one book, and starting another but I
have almost 0 practice.
Q1. so far I haven't been able to produce the effect of the
Word Spacing property. I tried all kinds of tests and I don't know
in what scenario this effect will show. Can someone give me a
simple example that shows the effect of this CSS property.
Q2. Vertical Alignment: this works well with images inserted
into text but I also expected this to work with text against other
text. For example I typed TEST© and assigned a different SCC
style to the © so that I can make it smaller and put it up
with the Vertical Alignment property. Surprisingly this propery
didn't produce any effect. How is htis suppose to be done?> This is some text. This is some text.
You forgot to wrap your text in <p> tags so the style
rule you created
doesn't apply.
Walt
"emil emil" <[email protected]> wrote in
message
news:[email protected]...
>
quote:
Originally posted by:
Newsgroup User
> i don't know about Q1. but for Q2. just delete what you
already have for
> the copyright symbol, and then insert the copyright
special character.
> there's a couple ways to do it: on the main menu at the
top of the
> window, go to Insert, then HTML, then Special
Characters, and select
> Copyright. or you can also find it in the Insert panel,
which is below
> the menu, under Text. ...
>
>
> Thanks courtney, but that was exactly the way I created
the © character
> and
> like in this text here it needs to be scaled down and
moved up
> independently
> from the surrounding text. Can someone please post a
simple code showing
> the
> effect of the vertical alignment of text in relation to
surrounding text.
>
>
>
quote:
Originally posted by:
Newsgroup User
> Q1
>
> <html>
> <head>
> <style type="text/css">
> p
> {
> word-spacing: 30px
> }
> </style>
> </head>
> <body>
>
> <p>
> This is some text. This is some text.
> </p>
>
> </body>
> </html>
>
>
> Thank you Ken, your code works but not the code
generated from
> Dreamweaver
> when I type in the Design View and assing CSS style to
the p tag. Does
> Dreamweaver have trouble generating properly working
HTML or I'm missing
> something here? Here is the code that Dreamweaver
generates and the word
> spacing doesn't work with it.
>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN"
> "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> <html xmlns="
http://www.w3.org/1999/xhtml">
> <head>
> <meta http-equiv="Content-Type" content="text/html;
charset=utf-8" />
> <title>Untitled Document</title>
> <style type="text/css">
> <!--
> p {
> word-spacing: 50em;
> }
> -->
> </style>
> </head>
>
> <body>
> This is some text. This is some text.
> </body>
> </html>
>
>
> -
Queries about PS module and subsequent integration with MM, SD and PP
Hello Experts,
Am posting the query for the first time so hope you all will excuse if something is not correct. Here is a scenario that I am working on:
- The customer is a project engineering company wanting to use PS (but without networks - ONLY WBS)
- We copy the neutral material BOM to create a project BOM
- We create a multi-item sales order with a/c assignment to different assembly groups from the project structure for deliveries and billing
- Project COST planning (V002 and V000) is carried out
- Material stock must be valuated
Following are the scenarios for commitment and actual costs:
1. Direct procurement:
Process: Material purchased with a PR generated from SO item --> PO --> GR --> IR
Query: I am guessing that commitment will be generated through PO creation for WBS. What about actual? What type of cost element should be assigned to the G/L being affected during GR so that I can get some actual against the WBS?
2. Procure to produce:
Process:
Common Purchase: Material purchased through a normal PO (without a/c assignment to WBS) for common unrestricted stock.
Project purchase: Material purchased through project PO (with a/c assignment to WBS - resulting in commitment generation) and special project stock at the time of GR
Both materials (from common and project PO) shall be used for production of an assembly which is being produced using a production order which is assigned to the WBS element.
Query:
How and when would I be getting the commitment / actual effects here?
- Is any commitment generated when I create a production order?
- Is any actual cost posted when I issue raw material to this production order?
- What if the raw material being issued to production order was not purchased using this WBS? Is the actual cost still loaded on this WBS?
- What happens when I confirm the production order to generate FG stock?
What should I be careful about when defining this scenario and what type of cost elements should I be using?
3. Procure - Produce - Sale
Process: In certain cases, material procured for common stock is issued for project production,
Material produced for one WBS/Project gets issued for another.
Query: How does SAP react in this case about the entire commitments and actual cost postings?
I know there are too many queries but I hope you all understand that it is a project-engineering-manufacturing company so on one side the commitment-actual costs are important to be assigned to right project-WBS. At the same time, they also want to have the flexibility in their production activities.
Awaiting eagerly for all possible help.Link farming is not allowed on this forum. Hence, i would not be able to post any links here. Just to get you started type "SAP Help" in Google. Open the 1st link and under Frequently used click on "ERP Central Components". Then under SAP ERP Central Component 6.0 click on "English". This will take you to a new window. Here, again click on "SAP ERP Central Component". Then click on Logistics - Project System.
You can find all the relevant topics listed here. Go through each one of them and revert with specific queries. -
I continually get the "rebuffering" prompt when trying to preview new music prior to purchase. It will stop playing the song after about 15 seconds. Can anyone tell me what is going on? Help will be appreciated.
Hey everyone in Apple world!
I figured out how to fix the flashing yellow screen problem that I've been having on my MBP! Yessssss!!!
I found this super handy website with the golden answer: http://support.apple.com/kb/HT1379
I followed the instructions on this page and here's what I did:
Resetting NVRAM / PRAM
Shut down your Mac.
Locate the following keys on the keyboard: Command (⌘), Option, P, and R. You will need to hold these keys down simultaneously in step 4.
Turn on the computer.
Press and hold the Command-Option-P-R keys before the gray screen appears.
Hold the keys down until the computer restarts and you hear the startup sound for the second time.
Release the keys.
I went through the 6 steps above twice, just to make sure I got rid of whatever stuff was holding up my bootup process. Since I did that, my MBP boots up just like normal. No flashing yellow screen anymore!!
(Note that I arrived at this solution when I first saw this page: http://support.apple.com/kb/TS2570?viewlocale=en_US)
Let me know if this works for you!
Elaine -
A quick question about WebDynpro SLD and R/3 with concurrent users
Hello ,
I have a very quick question about Webdynpros and SLD connecting to an R/3 system, when you configure a webdynpro to connect to an R/3 system using SLD, you configure a user name and password from the R/3 for the SLD to use. What I would like to know is when I have concurrent users of my webdynpro, how can I know what one user did in R/3 and what another user did? Is there a way for the users of the web dynpro to use their R/3 credentials so SLD can access the R/3? Like dynamically configuring the SLD for each user?
- I would like to avoid leaving their their passwords open in the code ( configuring two variable to get the users username and password and use these variables as JCO username and password )
Thanks Ubergeeks,
GuyHi Guy
You will have to use Single Sign On to achieve this. In the destination you have defined to connect to R/3 , there is an option to 'useSSO' instead of userid and password. This will ensure that calls to R/3 will be with the userid that has logged into WAS. You wont need to pass any passwords because a login ticket is generated from WAS and passed on to R/3. The userid is derived from this ticket.
For this to happen you will have to maintain a trust relation ship between R/3 and your WAS ,there is detailed documentation of this in help files. Configuration is very straight forward and is easy to perform
Regards
Pran -
Software compatibility About ORACLE BC and ADF 11g with Sybase Database
I am using jdeveloper 11g xxx.0.2, and our company is using Sybase 12.x ASE. Our team chose Jdeveloper 11g and BC with ADF as our architecture. But during about 2 months, we found the bug (just with sybase db server) becomes more and more, strange, the dialect which we can choose does not have sybase (the have Oracle,Sql Server,DB2,SQL92 and others), we now have the only one way -- to choose SQL 92. But many bugs or other problem comes out, sometimes we event have to write lots of codes to realise a very very simple function. is that all because there's no sybase dialect or i guess the sqlbuilder for sybase database? Someone can explain why? or can help me go through the trouble? We need your help!!!!!!
Thanks for reply, we can not change our tech now, and could you please show me a way? should I extend baseSqlBuilderImpl and override some important methods there to generate sql suitable in sybase?
I have override the sql generate method and the lov bug was fixed( The bug is IT recognize int var as a string var, and uses like instead of =), but we still can't fix view criteria, the default declarative view criteria can not run most time. And i don't know why. can adf support team to do a enhancement for sybase? Thanks a lot
Edited by: Roger Liu on Oct 29, 2009 6:10 AM -
Similar to many others storage mystically filling up everyday with nothing new being put on. Only solution is to testers ipad then get totally free storage until later that day or next day. Hoping for a software fix.
How much space is used by your Other? You may be able to reduce.
How Do I Get Rid Of The “Other” Data Stored On My iPad Or iPhone?
http://tinyurl.com/85w6xwn
How to Remove “Other” Data from iPhone, iPad and iPod Touch
http://www.igeeksblog.com/how-to-remove-other-data-from-iphone/
With an iOS device, the “Other” space in iTunes is used to store things like documents, settings, caches, and a few other important items. If you sync lots of documents to apps like GoodReader, DropCopy, or anything else that reads external files, your storage use can skyrocket. With iOS 5/6/7, you can see exactly which applications are taking up the most space. Just head to Settings > General > Usage, and tap the button labeled Show All Apps. The storage section will show you the app and how much storage space it is taking up. Tap on the app name to get a description of the additional storage space being used by the app’s documents and data. You can remove the storage-hogging application and all of its data directly from this screen, or manually remove the data by opening the app. Some applications, especially those designed by Apple, will allow you to remove stored data by swiping from left to right on the item to reveal a Delete button.
What is “Other” and What Can I Do About It?
https://discussions.apple.com/docs/DOC-5142
iPhone or iPad Ran Out of Storage Space? Here’s How to Make Space Available Quickly
http://osxdaily.com/2012/06/02/iphone-ipad-ran-out-of-available-storage-space-ho w-to-fix-quick/
6 Tips to Free Up Tons of Storage Space on iPad, iPhone, and iPod Touch
http://osxdaily.com/2012/04/24/6-tips-free-up-storage-space-ipad-iphone-ipod-tou ch/
Also,
How to Clear Message/iMessage Cache on iPhone & iPad And Reclaim Lots of Free Space
http://www.igeeksblog.com/how-to-clear-message-imessage-cache-on-iphone-ipad/
What is Stored in iCloud and What is Not
https://sites.google.com/site/appleclubfhs/support/advice-and-articles/what-is-s tored-in-icloud
Cheers, Tom -
Webcast Archive and Test Questions with DVD Pro Studio
Is there a way to put a web archive of a Mediasite (by Sonic Foundry) webcast into a DVD that can be played on a TV through a traditional DVD player? I know you can link a site to pull up in a web browser when you use the DVD in a computer, but I was wondering if you could embed the archive file they give us on a CD into the DVD menu.
Additionally is there a way that you can make a series of questions for a training test into the DVD menu, so the student can select answers and then see which ones they scored right and which they scored wrong?
Thank you,
RAY PEARSONRay - the only way you can get this stuff showing on your DVD is to re-create it using video tools like FCP, or convert the footage that you have got to be MPEG2 and then sue it in DVDSP.
The answers you already have here are pointing you this way - you can do lots of things, but some stuff just isn't possible.
For the playback of the CD content, you might consider using a tool like Snapz Pro to record your computer screen (or rather, and area of it) whilst you use the CD and navigate the contents. The output from Snapz can be saved as DV footage with audio, and of course this can then be converted to go onto a DVD.
I think there are ways ahead for you, but it isn't straightforward! -
We are seeing any issue with iphone 6 and 6+ phones receiving "Unknown" on the caller id when they receive a call from a PBX system. All other versions of iphones are not having this issue. I have read several forums and it seems to be a carrier issue with the new LTE towers. Has anyone else experienced this issue?
yes its a new issue for me too. Are you a ATT customer? My brother has iphone 6 but with another carrier and has no problems..
-
About advance receipt and its flow with the Sales Order
Hi Friends,
I work for a construction client. Here I have a scenario where the client recieves a down payment on the flats from the customers before raising a Sales Order. The query is how does the client attach this particular receipt of down payment to a particular plant (in other words, there are so many buildings under construction, and the customer would make a payment for a particular flat in a particular building and the receipt is to be raised for one particular flat of a particular floor, in one particular building), how do we go about tracking the same.
Pls suggest.
Regards
Soujanya.Thank you!
But I get the following message in VL01N:
"No schedule lines due for delivery up to the selected date "
What does it mean exacly?
I have a Confirmed Production Order.
I have a quantity in CSTOCK.
So, what is missing here?
Thanks in advance!
Rudy -
"How to sum FKIMG in VBRK and VBRP Table with sample output
Sir\Mam\Gurus ;
I hardly found it difficult in resolving my program in getting the sum of FKIMG inside the VBRP and VBRK tables
The scenario is that i have one Sales Order with multiple invoices . What i need to do is to sum up the fkimg or the quanitity of specific material regardless of how many invoices the material have in a particular SO
Example I have Sales Order number 35678952 with
3 invoices
Invoice # 123 with material number mat1=12, mat2=5 , mat3=7
345 with material number mat1=7, mat2=7
678 with material number mat1=5, mat3=10
Output shoud be
salesorder# 35678952
mat1 = 24
mat2 = 12
mat3 = 17
Below is my Sample Codes:
DATA : it_vbrp_details TYPE STANDARD TABLE OF wa_vbrp_details,
ls_vbrp_details TYPE wa_vbrp_details,
ls_vbrp_details1 TYPE wa_vbrp_details,
lsfinal_vbrp_details TYPE wa_vbrp_details,
it2_vbrp_details TYPE STANDARD TABLE OF wa2_vbrp_details,
ls2_vbrp_details TYPE wa2_vbrp_details,
it3_vbrp_details TYPE STANDARD TABLE OF wa_vbrp_details,
itfinal1_vbrp_details TYPE STANDARD TABLE OF wa_vbrp_details,
itfinal2_vbrp_details TYPE STANDARD TABLE OF wa_vbrp_details,
itfinal3_vbrp_details TYPE STANDARD TABLE OF wa_vbrp_details,
ls3_vbrp_details TYPE wa_vbrp_details,
rtime1 TYPE i,
rtime2 TYPE i,
rtime3 TYPE i,
s_erdate type d,
scr_erdat type d,
s_erdate = scr_erdat.
CALL FUNCTION 'MONTH_PLUS_DETERMINE'
EXPORTING
months = 1 " Negative to subtract from old date, positive to add
olddate = s_erdate
IMPORTING
newdate = new_date.
""" This is another way manual adding by days
CALL FUNCTION 'CALCULATE_DATE'
EXPORTING
days = +30
start_date = s_erdate
IMPORTING
result_date = new_date.
result_date = ddate.
REFRESH: it_vbrp_details.
SELECT
vbrp~matnr
vbrp~aubel
vbrp~aupos
vbrp~vbeln
vbrp~kzwi1
vbrp~kzwi2
vbrp~kzwi3
vbrp~kzwi4
vbrp~kzwi5
vbrp~kzwi6
vbrp~mvgr1
vbrp~mvgr2
vbrp~mvgr3
vbrp~mvgr4
vbrp~mvgr5
vbrp~knuma_pi
vbrp~knuma_ag
vbrp~mwsbp
vbrp~vkaus
vbrp~fkimg
vbrk~vbeln
vbrk~fkart
vbrk~belnr
vbrk~xblnr
vbrk~vbtyp
vbrk~kunag
vbrk~fksto
vbap~posnr
INTO TABLE it_vbrp_details
FROM vbrp INNER JOIN vbrk ON vbrkvbeln EQ vbrpvbeln
where vbeln eq gt_data-vbeln
where vbrpaubel eq vbapvbeln
WHERE vbrp~posnr GE ''
AND vbrk~vbtyp EQ 'M'
AND vbrk~fksto NE 'X'
AND ( vbrperdat GE s_erdate OR vbrperdat LE new_date OR vbrp~erdat IN s_erdat ) " + JP 09 19 2011 Additional Optimization
ORDER BY aubel aupos .
ORDER BY aubel aupos matnr.
"""" This where i need your help Sir\Mam\Gurus
it3_vbrp_details = it_vbrp_details.
SORT it3_vbrp_details BY aubel matnr fkimg kzwi1 kzwi2 kzwi3 kzwi4 kzwi5 kzwi6 aupos vbeln
mvgr1 mvgr2 mvgr3 mvgr4 mvgr5 knuma_pi knuma_ag mwsbp vkaus fkart belnr vbtyp kunag fksto.
LOOP AT it3_vbrp_details INTO ls_vbrp_details.
COLLECT ls_vbrp_details INTO itfinal1_vbrp_details.
APPEND ls_vbrp_details TO it_vbrp_details.
ENDLOOP.
kzwi1,kzwi2,kzwi3 is also been sum up
Sir the output is something like this
Sales Ord# Material Qty KWIZ1 KWIZ2 KWIZ3 MGVR1 VBELN
1234 Mat1 24 23.2 22 12 LastInvoice#
1234 Mat2 12 20.0 21 15 LastInvoice#
1234 Mat3 37 22.0 22 16 LastInvoice#
5432 Mat1 30 25.0 23 15 LastInvoice#
5432 Mat2 24 22.0 24 23 LastInvoice#
5432 Mat3 20 18.0 20 12 LastInvoice#
Hope you can help me as i cant hardy sleep thinking of this ...
I will really appreciate your great help..
Thanks !
I will really appreciate your great help..
Thanks !
Moderator message: duplicate post locked.
Edited by: Thomas Zloch on Sep 20, 2011 3:05 PMHi,
How you want to display the output?..
If you want to display the output as mentioned below, then you have to use nested loop & dynamic field assignments to get result.
Output column
sales order Mat1 Mat2 Mat3 ......
1234 24 12 37
Kindly let me know, if you have any questions
Regards,
S.Senthilkumar -
XSL and FSG report with XML output
I have 5 FSG Reports combined into one reportset. all these reports output type as XML. Once the reportset is submitted and all the FSG reports are completed , i want to call a XSL program which will combine all the 5 FSG XML outputs. Please advice me how to use the xsl program to combine all the FSG XML Outputs.
Phew thats gonna be some XSL bearing in mind how complex the FSG XML is. How much data are we talking about here ? There might be a simpler solution as long as there is not a huge amount of data.
REgards, Tim -
How to Create and adjust masks with SDI output or Dual monitor output activated?
Hi all Speedgrade community.
For me one of the biggest problems I constantly encounter is managing masks within speed grade.
The tools are great, but if your using and external reference monitor for grading there is no way you can manage
masks and see what your doing on that "external" screen. Is there a way of activating dual screen or ddi output and keeping
the viewer active in the GUI?
When I know I'm going to be managing a lot of fine tuning grading, I usually always switch to Scratch or Resolve, and that breaks my Adobe CC round tripping workflow
AE<-->PP<-->SG
Thanks for any help.
KR
Leigh
iMac 27"
Aja IO 4K
DreamColor Z27X
HDLink 3D DisplayPort
Wacom IntuosHi Fran
Thanks for your response.
Is it just me, or does the pointer, when sent over to the SDI output, not respond as well
as when it's on the GUI?
Anyway, I'm quit confident we'll see an update to the way video is routed within Speedgrade
in a near future.
Leigh
Maybe you are looking for
-
Vtok video chatting is not working on my iphone 4s. When I try to do a video chat with my gmail chat contacts who are using a PC we each only get the voice part of the chat and no video. Is there some way to fix this or is there another program that
-
Can anyone help with my sound query?
Hi all I need to load from a file a sound clip and for it to play when a button is pressed- the difficult bit is without referencing Applet. Can anyone help? Thanks
-
In process inspection(QM)
Hii , In case of Inprocess inspection , we offered particular operation for confirmation to QC. If QC rejects the lot through usuage decision system is allowing confirmation of that operation. I dont want to allow the confirmation of operation if its
-
Best Practices - Authorization Management
Hello: I am quite familiar with R/3 security, however I am new to BW. We are using BW 3.5. We are trying to figure out the best approach to handle our authorization requirements. Here are some of our goals: 1) Master authorization will be maintained
-
COPA user-defined charact. w. own value maint. with existing check-table
Dear Experts, I need to create a user-defined characteristic with own value maintenance with the pecularity that it needs to refer to the same check table as another user-defined characteristic with own value maintenance. Could anybody explain me how