URL
https://opencores.org/ocsvn/ssbcc/ssbcc/trunk
[/] [ssbcc/] [trunk/] [core/] [9x8/] [macros/] [outstrobe.py] - Blame information for rev 3
Go to most recent revision |
Details |
Compare with Previous |
View Log
| Line No. |
Rev |
Author |
Line |
| 1 |
3 |
sinclairrf |
# Copyright 2014, Sinclair R.F., Inc.
|
| 2 |
|
|
|
| 3 |
|
|
def outstrobe(ad):
|
| 4 |
|
|
"""
|
| 5 |
|
|
Built-in macro to send strobes to the specified strobe-only output port.\n
|
| 6 |
|
|
Usage:
|
| 7 |
|
|
.outstrobe(O_name)
|
| 8 |
|
|
where
|
| 9 |
|
|
O_name is the name of the output port\n
|
| 10 |
|
|
The effect is: To active the strobe at the specified output port.\n
|
| 11 |
|
|
( - )
|
| 12 |
|
|
"""
|
| 13 |
|
|
|
| 14 |
|
|
# Add the macro to the list of recognized macros.
|
| 15 |
|
|
ad.AddMacro('.outstrobe', 2, [ ['','symbol'] ]);
|
| 16 |
|
|
|
| 17 |
|
|
# Define the macro functionality.
|
| 18 |
|
|
def emitFunction(ad,fp,argument):
|
| 19 |
|
|
if not ad.IsOutstrobe(argument[0]['value']):
|
| 20 |
|
|
raise asmDef.AsmException('Symbol "%s" is not a strobe-only output port at %s' % (argument[0]['value'],argument[0]['loc']));
|
| 21 |
|
|
name = argument[0]['value'];
|
| 22 |
|
|
ad.EmitPush(fp,ad.OutportAddress(name) & 0xFF,name);
|
| 23 |
|
|
ad.EmitOpcode(fp,ad.InstructionOpcode('outport'),'outport');
|
| 24 |
|
|
ad.EmitFunction['.outstrobe'] = emitFunction;
|
© copyright 1999-2026
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.