OpenCores
URL https://opencores.org/ocsvn/copyblaze/copyblaze/trunk

Subversion Repositories copyblaze

[/] [copyblaze/] [trunk/] [copyblaze/] [sw/] [tools/] [asm/] [pBlazASM/] [Main - pblazasm - Picoblaze (R) command line assembler and merger - Picoblaze (R) commandline assembler and vhdl verilog file merger - Google Project Hosting.htm] - Blame information for rev 52

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 ameziti
 
2
 
3
 
4
 
5
 
6
 
7
 
8
 
9
 
10
 
11
 
12
 
13
 
14
 <!DOCTYPE html>
15
<html>
16
<head>
17
 <link rel="icon" type="image/vnd.microsoft.icon" href="http://www.gstatic.com/codesite/ph/images/phosting.ico">
18
 
19
 
20
 <link rel="canonical" href="http://code.google.com/p/pblazasm/wiki/Main" />
21
 
22
 <script type="text/javascript">
23
 
24
 
25
 
26
 
27
 var codesite_token = "69ccc810eb65d900c7571852ed2f21bc";
28
 
29
 
30
 var CS_env = {"profileUrl":["/u/@VhdVS1RVBhdHXgN9/"],"token":"69ccc810eb65d900c7571852ed2f21bc","assetHostPath":"http://www.gstatic.com/codesite/ph","domainName":null,"assetVersionPath":"http://www.gstatic.com/codesite/ph/13841197563397998716","projectHomeUrl":"/p/pblazasm","relativeBaseUrl":"","projectName":"pblazasm","loggedInUserEmail":"meziti.abdallah@gmail.com"};
31
 var _gaq = _gaq || [];
32
 _gaq.push(
33
 ['siteTracker._setAccount', 'UA-18071-1'],
34
 ['siteTracker._trackPageview']);
35
 
36
 _gaq.push(
37
 ['projectTracker._setAccount', 'UA-10408907-2'],
38
 ['projectTracker._trackPageview']);
39
 
40
 
41
 </script>
42
 
43
 
44
 <title>Main -
45
 pblazasm -
46
 
47
 Picoblaze (R) command line assembler and merger -
48
 Picoblaze (R) commandline assembler and vhdl/verilog file merger - Google Project Hosting
49
 </title>
50
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" >
51
 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" >
52
 
53
 <meta name="ROBOTS" content="NOARCHIVE">
54
 
55
 <link type="text/css" rel="stylesheet" href="http://www.gstatic.com/codesite/ph/13841197563397998716/css/core.css">
56
 
57
 <link type="text/css" rel="stylesheet" href="http://www.gstatic.com/codesite/ph/13841197563397998716/css/ph_detail.css" >
58
 
59
 
60
 
61
 <link type="application/atom+xml" rel="alternate" href="/feeds/p/pblazasm/svnchanges/basic?path=/wiki/Main.wiki">
62
 
63
 
64
<!--[if IE]>
65
 <link type="text/css" rel="stylesheet" href="http://www.gstatic.com/codesite/ph/13841197563397998716/css/d_ie.css" >
66
<![endif]-->
67
 <style type="text/css">
68
 .menuIcon.off { background: no-repeat url(http://www.gstatic.com/codesite/ph/images/dropdown_sprite.gif) 0 -42px }
69
 .menuIcon.on { background: no-repeat url(http://www.gstatic.com/codesite/ph/images/dropdown_sprite.gif) 0 -28px }
70
 .menuIcon.down { background: no-repeat url(http://www.gstatic.com/codesite/ph/images/dropdown_sprite.gif) 0 0; }
71
 
72
 
73
 #maincol {
74
 padding-top: 0;
75
 padding-bottom: 0;
76
 }
77
 
78
 
79
 </style>
80
</head>
81
<body class="t6">
82
<script type="text/javascript">
83
 (function() {
84
 var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
85
 ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
86
 (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(ga);
87
 })();
88
</script>
89
<div class="headbg">
90
 
91
 <div id="gaia">
92
 
93
 
94
 <span>
95
 
96
 
97
 <b>meziti.abdallah@gmail.com</b>
98
 
99
 
100
 | <a href="/u/@VhdVS1RVBhdHXgN9/" id="projects-dropdown" onclick="return false;"
101
 ><u>My favorites</u> <small>&#9660;</small></a>
102
 | <a href="/u/@VhdVS1RVBhdHXgN9/" onclick="_CS_click('/gb/ph/profile');"
103
 title="Profile, Updates, and Settings"
104
 ><u>Profile</u></a>
105
 | <a href="https://www.google.com/accounts/Logout?continue=http%3A%2F%2Fcode.google.com%2Fp%2Fpblazasm%2Fwiki%2FMain"
106
 onclick="_CS_click('/gb/ph/signout');"
107
 ><u>Sign out</u></a>
108
 
109
 </span>
110
 
111
 </div>
112
 
113
 <div class="gbh" style="left: 0pt;"></div>
114
 <div class="gbh" style="right: 0pt;"></div>
115
 
116
 
117
 <div style="height: 1px"></div>
118
<!--[if lte IE 7]>
119
<div style="text-align:center;">
120
Your version of Internet Explorer is not supported. Try a browser that
121
contributes to open source, such as <a href="http://www.firefox.com">Firefox</a>,
122
<a href="http://www.google.com/chrome">Google Chrome</a>, or
123
<a href="http://code.google.com/chrome/chromeframe/">Google Chrome Frame</a>.
124
</div>
125
<![endif]-->
126
 
127
 
128
 
129
 
130
 <table style="padding:0px; margin: 0px 0px 10px 0px; width:100%" cellpadding="0" cellspacing="0"
131
 itemscope itemtype="http://schema.org/CreativeWork">
132
 <tr style="height: 58px;">
133
 
134
 <td id="plogo">
135
 <link itemprop="url" href="/p/pblazasm">
136
 <a href="/p/pblazasm/">
137
 
138
 
139
 <img src="/p/pblazasm/logo?cct=1242918360"
140
 alt="Logo" itemprop="image">
141
 
142
 </a>
143
 </td>
144
 
145
 <td style="padding-left: 0.5em">
146
 
147
 <div id="pname">
148
 <a href="/p/pblazasm/"><span itemprop="name">pblazasm</span></a>
149
 </div>
150
 
151
 <div id="psum">
152
 <a id="project_summary_link"
153
 href="/p/pblazasm/"><span itemprop="description">Picoblaze (R) commandline assembler and vhdl/verilog file merger</span></a>
154
 
155
 </div>
156
 
157
 
158
 </td>
159
 <td style="white-space:nowrap;text-align:right; vertical-align:bottom;">
160
 
161
 <form action="/hosting/search">
162
 <input size="30" name="q" value="" type="text">
163
 
164
 <input type="submit" name="projectsearch" value="Search projects" >
165
 </form>
166
 
167
 </tr>
168
 </table>
169
 
170
</div>
171
 
172
 
173
<div id="mt" class="gtb">
174
 <a href="/p/pblazasm/" class="tab ">Project&nbsp;Home</a>
175
 
176
 
177
 
178
 
179
 
180
 
181
 <a href="/p/pblazasm/w/list" class="tab active">Wiki</a>
182
 
183
 
184
 
185
 
186
 
187
 
188
 
189
 <a href="/p/pblazasm/source/checkout"
190
 class="tab ">Source</a>
191
 
192
 
193
 
194
 
195
 
196
 <div class=gtbc></div>
197
</div>
198
<table cellspacing="0" cellpadding="0" width="100%" align="center" border="0" class="st">
199
 <tr>
200
 
201
 
202
 
203
 <td class="subt">
204
 <div class="issueDetail">
205
<div class="isf">
206
 
207
 <span class="inIssueList">
208
 <span>Search</span>
209
 <form action="/p/pblazasm/w/list" method="GET" style="display:inline">
210
 <select id="can" name="can" >
211
 <option disabled="disabled">Search within:</option>
212
 
213
 <option value="1" >&nbsp;All wiki pages</option>
214
 <option value="3" >&nbsp;Featured pages</option>
215
 <option value="2" selected="selected">&nbsp;Current pages</option>
216
 
217
 
218
 <option value="5" >&nbsp;My starred pages</option>
219
 
220
 <option value="4" >&nbsp;Deprecated pages</option>
221
 
222
 </select>
223
 <span>for</span>
224
 <span id="qq"><input type="text" size="38" id="searchq" name="q" value=""
225
 autocomplete="off" ></span>
226
 
227
 
228
 
229
 <input type="submit" value="Search" >
230
 </form>
231
 </span>
232
 
233
 
234
 
235
 
236
 
237
 
238
 
239
 
240
 
241
</div>
242
</div>
243
 
244
 </td>
245
 
246
 
247
 
248
 
249
 
250
 
251
 <td align="right" valign="top" class="bevel-right"></td>
252
 </tr>
253
</table>
254
 
255
 
256
<script type="text/javascript">
257
 var cancelBubble = false;
258
 function _go(url) { document.location = url; }
259
</script>
260
<div id="maincol"
261
 
262
>
263
 
264
 
265
<!-- IE -->
266
 
267
 
268
 
269
 
270
 
271
 
272
 
273
 <style type="text/css">
274
 .delcom { background: #e8e8e8 }
275
 .commentcontent {
276
 margin: 2em;
277
 padding: 0px 10px;
278
 width: 66em;
279
 }
280
 .artifactcomment {
281
 border-top: 3px solid #c3d9ff;
282
 }
283
 #commentform {
284
 border-top: 3px solid #c3d9ff;
285
 }
286
 </style>
287
 
288
<div id="wikipage">
289
<table>
290
 <tr>
291
 
292
 
293
 <td style="vertical-align:top; padding-left:5px">
294
 
295
 <div id="wikiheader">
296
 
297
 <img width="15" height="15" id="star_img"
298
 src="http://www.gstatic.com/codesite/ph/images/star_off.gif"
299
 style="cursor:pointer"
300
 
301
 onclick="_CS_toggleStar(this,
302
 '',
303
 {'scope': 'wiki',
304
 'user': '_CURRENT_USER',
305
 'item': 'pblazasm:Main',
306
 'token': codesite_token
307
 });"/>
308
 
309
 <span style="font-size:120%;font-weight:bold">Main</span>
310
 &nbsp;
311
 <div>
312
 
313
 <i>Picoblaze (R) command line assembler and merger</i>
314
 
315
 
316
 
317
 <div id="wikiauthor" style="float:right">
318
 Updated <span title="Thu Mar 31 02:32:59 2011">
319
 Mar 31, 2011</span>
320
 
321
 by <a style="white-space: nowrap" href="/u/mediatronix/">mediatronix</a>
322
 
323
 </div>
324
 </div>
325
 </div>
326
 
327
 <div id="wikicontent">
328
 <div class="vt" id="wikimaincol">
329
 <h1><a name="Introduction"></a>Introduction<a href="#Introduction" class="section_anchor"></a></h1><p>The main feature of this assembler is the possibility to initialize the contents of the scratch-pad memory, provided it is implemented as a block-ram. The scratch-pad memory can be the second port of the code rom; this port is an 8-bit port. You can write: </p><pre class="prettyprint">        .SCR   0x380     ; equal to 0x700 as seen from the 8 bit-port.
330
prompt  .TXT  &quot;\r\n&gt;&gt;&quot;   ; 5 characters, CR, LF, 2 &#x27;&gt;&#x27;s and a trailing zero.
331
count   .BUF   4         ; uninitialized 4 byte variable
332
end     .BYT   0x55      ; initialized 1 byte variable</pre><h1><a name="Directives"></a>Directives<a href="#Directives" class="section_anchor"></a></h1><h3><a name=".EQU"></a>.EQU<a href="#.EQU" class="section_anchor"></a></h3><p>Equate the value of an identifier to the value of the expression. </p><pre class="prettyprint">Ten     .EQU   2 * 5     ; The ident Ten now has the value 10
333
Accu    .EQU   s8        ; The ident Accu can be used instead of register s8</pre><h3><a name=".ORG"></a>.ORG<a href="#.ORG" class="section_anchor"></a></h3><p>Set the origin of the next instruction </p><pre class="prettyprint">        .ORG   0x100</pre><h3><a name=".SCR"></a>.SCR<a href="#.SCR" class="section_anchor"></a></h3><p>Set the origin of the scratchpad memory in the code rom in case the second port of the code rom blockram is used as such or set it to 0x400 if a different blockram is used. </p><pre class="prettyprint">        .SCR   0x380      ; use the last 128 words (=256 bytes) of the code rom
334
 
335
        .SCR   0x400      ; use a separate blockram or distributed ram</pre><h3><a name=".TXT"></a>.TXT<a href="#.TXT" class="section_anchor"></a></h3><p>Initialize the scratchpad with the textstring, including a zero byte. </p><pre class="prettyprint">prompt  .TXT  &quot;\r\n&gt;&gt;&quot;   ; 5 characters, CR, LF, 2 &#x27;&gt;&#x27;s and a trailing zero.</pre><h3><a name=".BYT"></a>.BYT<a href="#.BYT" class="section_anchor"></a></h3><pre class="prettyprint">ver     .BYT   0x55      ; initialized 1 byte variable</pre><h3><a name=".WBE_and_.WLE"></a>.WBE and .WLE<a href="#.WBE_and_.WLE" class="section_anchor"></a></h3><pre class="prettyprint">val2    .WBE   0xAA55    ; initialized 2 byte variable, AA first byte
336
val3    .WLE   0xAA55    ; initialized 2 byte variable, 55 first byte</pre><h3><a name=".LBE_and_.LLE"></a>.LBE and .LLE<a href="#.LBE_and_.LLE" class="section_anchor"></a></h3><pre class="prettyprint">val2    .LBE   0xAA123455 ; initialized 4 byte variable, AA first byte
337
val3    .LLE   0xAA123455 ; initialized 4 byte variable, 55 first byte</pre><h3><a name=".BUF"></a>.BUF<a href="#.BUF" class="section_anchor"></a></h3><pre class="prettyprint">count   .BUF   4         ; uninitialized 4 byte variable</pre><h1><a name="Prefered_mnemonics"></a>Prefered mnemonics<a href="#Prefered_mnemonics" class="section_anchor"></a></h1><pre class="prettyprint">  MOVE instead of LOAD
338
  LD   instead of FETCH
339
  ST   instead of STORE
340
 
341
  RET  instead of RETURN
342
  RETI instead of RETURNI
343
 
344
  ADDC instead of ADDCY
345
  SUBC instead of SUBCY
346
 
347
  IN   instead of INPUT
348
  OUT  instead of OUTPUT
349
 
350
  EINT instead of ENABLE INTERRUPT
351
  DINT instead of DISABLE INTERRUPT  </pre><h1><a name="Scratchpad_Initialization"></a>Scratchpad Initialization<a href="#Scratchpad_Initialization" class="section_anchor"></a></h1><p>Initialization of the scratchpad memory is done is the assembler source by specifying the origin of the scratchpad by the .SCR directive. The scratchpad can be either the blockram used for the CodeROM itself using the second (byte-wide) port of that blockram or the distributed memory based scratchpad as implemented in the original kcpsm3 core. Basically the pBlazMEM tool replaces instances on {INIT_XX}, {INITP_XX} and {INITD_XX} by constant strings with the appropriate values, similar to the kcpsmasm tool of Xilinx. New is the possibility to initializing the scratchpad in addition to initializing the CodeROM. </p><p>New is the {INITD_XX} template to initialize distributed ram parts. Use someting like this: </p><pre class="prettyprint">{begin template} -- at start of file
352
...
353
store_block: block is
354
        type INIT_ARRAY_t is array( 0 downto 7 ) of bit_vector( 63 downto 0 ) ;
355
        constant INIT_ARRAY : INIT_ARRAY_t := (
356
                B&quot;{INITD_00}&quot;,
357
                B&quot;{INITD_01}&quot;,
358
                B&quot;{INITD_02}&quot;,
359
                B&quot;{INITD_03}&quot;,
360
                B&quot;{INITD_04}&quot;,
361
                B&quot;{INITD_05}&quot;,
362
                B&quot;{INITD_06}&quot;,
363
                B&quot;{INITD_07}&quot;
364
        ) ;
365
begin
366
        store_loop: for i in 0 to 7 generate
367
        begin
368
                memory_bit: RAM64X1S
369
                        generic map(
370
                                INIT =&gt; INIT_ARRAY( i )
371
                        )
372
                        port map (
373
                                D =&gt; sx( i ),
374
                                WE =&gt; memory_enable,
375
                                WCLK =&gt; clk,
376
                                A0 =&gt; second_operand( 0 ),
377
                                A1 =&gt; second_operand( 1 ),
378
                                A2 =&gt; second_operand( 2 ),
379
                                A3 =&gt; second_operand( 3 ),
380
                                A4 =&gt; second_operand( 4 ),
381
                                A5 =&gt; second_operand( 5 ),
382
                                O =&gt; memory_data( i )
383
                        ) ;
384
 
385
                store_flop: FD
386
                        port map (
387
                                D =&gt; memory_data( i ),
388
                                Q =&gt; store_data( i ),
389
                                C =&gt; clk
390
                        ) ;
391
        end generate store_loop ;
392
end block ;</pre><p>as a template instead of the store_loop construct in the KCPSM.VHD file. </p><h1><a name="Makefile"></a>Makefile<a href="#Makefile" class="section_anchor"></a></h1><p>Use a makefile like this to automate the assembly and merging: </p><pre class="prettyprint"># path to tools
393
AS=&quot;C:/SVN/pBlazASM/pBlazASM.exe&quot;
394
MG=&quot;C:/SVN/pBlazMRG/pBlazMRG.exe&quot;
395
 
396
RM = rm -f -v
397
CP = cp
398
 
399
# List of PSM Files
400
ASM_SRC = Init.psm Inband.psh SPI.psm I2C.psm UART.psm delay.psm Inband.psm MYROM.psm
401
AFLAGS = -l -m
402
MGFLAGS =
403
TEMPLATE = template
404
ENTITY = CodeROM
405
 
406
.SUFFIXES : .psm .mem .vhd .psh
407
 
408
# assemble and merge
409
all:    $(ENTITY).vhd
410
 
411
$(ENTITY).mem:  $(ASM_SRC)
412
        $(AS) $(ASM_SRC) $(AFLAGS)
413
 
414
$(ENTITY).vhd:  $(ENTITY).mem $(TEMPLATE).vhd
415
        $(MG) $(MGFLAGS) -e$(ENTITY) $(ENTITY).mem $(TEMPLATE).vhd $(ENTITY).vhd
416
        $(CP) $(ENTITY).vhd ..
417
 
418
# clean outputs
419
clean:
420
        $(RM) $(ENTITY).lst $(ENTITY).mem $(ENTITY).vhd                 </pre><h1><a name="Operation_with_BMM_and_MEM_in_an_ISE_project"></a>Operation with BMM and MEM in an ISE project<a href="#Operation_with_BMM_and_MEM_in_an_ISE_project" class="section_anchor"></a></h1><p>Use a BMM file like this to associate the MEM file with your ISE design: </p><pre class="prettyprint">ADDRESS_SPACE Code_ROM RAMB18 WORD_ADDRESSING [0x00000000:0x000003FF]
421
    BUS_BLOCK
422
        iPico/program/prog_rom [17:0] ;
423
    END_BUS_BLOCK;
424
END_ADDRESS_SPACE;</pre><p>The name of the block RAM (here: iPico/program/prog_rom) needs to be derived from the design through some voodoo, like xdl.exe. </p><p>Merge is not necessary anymore. Add the CodeROM.MRG and CodeROM.BMM files to your ISE project. Add the following &#x27;Other Bitgen Command Line Options&#x27; to the &#x27;Generate programming file&#x27; (BitGen) function of your ISE project: </p><pre class="prettyprint">      -bd CodeROM.MEM</pre><p>Now when &#x27;make&#x27;ing a new version of CodeROM.MEM, ISE will see it has changed and &#x27;Generate programming file&#x27; can be rerun to make a new bit/bin file. </p><p>Remove the merge step from the makefile, since it would invalidate CodeROM.VHD, which will trigger a full build of your FPGA, instead of a mere BitGen. </p>
425
 </div>
426
 </div>
427
 </td><tr>
428
</table>
429
 </div>
430
 
431
 
432
 
433
 
434
 
435
 
436
 
437
 <div id="commentform">
438
 <form action="../w/detail.do" method="post">
439
 <table>
440
 <tr><td class="vt">
441
 <input type="hidden" name="pagename" value="Main" >
442
 <input type="hidden" name="token" value="69ccc810eb65d900c7571852ed2f21bc" >
443
 <div class="graytext" style="float: right;">
444
 Hint: You can use <a href="http://code.google.com/p/support/wiki/WikiSyntax">Wiki Syntax.</a>
445
 </div>
446
 <div>Enter a comment:</div>
447
 <textarea name="content" rows="6" cols="100"></textarea><br><br>
448
 <input type="submit" name="submit" value="Submit" >
449
 </td>
450
 </table>
451
 </form>
452
 </div>
453
 
454
 
455
 
456
 
457
 
458
 <form name="delcom" action="../w/delComment.do" method="POST">
459
 <input type="hidden" name="sequence_num" value="" >
460
 <input type="hidden" name="create_time" value="" >
461
 <input type="hidden" name="mode" value="" >
462
 <input type="hidden" name="pagename" value="Main" >
463
 <input type="hidden" name="token" value="69ccc810eb65d900c7571852ed2f21bc" >
464
 </form>
465
 
466
 
467
 
468
 <script src="http://www.gstatic.com/codesite/ph/13841197563397998716/js/prettify/prettify.js"></script>
469
 <script type="text/javascript">
470
 prettyPrint();
471
 </script>
472
 
473
<script type="text/javascript" src="http://www.gstatic.com/codesite/ph/13841197563397998716/js/dit_scripts.js"></script>
474
 
475
 
476
<script type="text/javascript" src="https://apis.google.com/js/plusone.js">
477
</script>
478
 
479
 
480
 
481
 
482
 <script type="text/javascript" src="http://www.gstatic.com/codesite/ph/13841197563397998716/js/ph_core.js"></script>
483
 
484
 
485
 
486
 
487
 <script type="text/javascript" src="/js/codesite_product_dictionary_ph.pack.04102009.js"></script>
488
</div>
489
<div id="footer" dir="ltr">
490
 <div class="text">
491
 &copy;2011 Google -
492
 <a href="/projecthosting/terms.html">Terms</a> -
493
 <a href="http://www.google.com/privacy.html">Privacy</a> -
494
 <a href="/p/support/">Project Hosting Help</a>
495
 </div>
496
</div>
497
 <div class="hostedBy" style="margin-top: -20px;">
498
 <span style="vertical-align: top;">Powered by <a href="http://code.google.com/projecthosting/">Google Project Hosting</a></span>
499
 </div>
500
 
501
 
502
 
503
 
504
 
505
 </body>
506
</html>
507
 
508
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.