diff options
| author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-11-20 10:26:29 -0600 |
|---|---|---|
| committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-11-20 10:26:29 -0600 |
| commit | f0c477eef466d0fbf47ecd92161c38ae474aa9ae (patch) | |
| tree | dddf45e3caae4864f70fcaa26ca91a6d1845098d /fpga/xilinx/programmer/bit2svf/commands.c | |
| parent | d94bf35fe7f2c30c5ea333eb0c97c20f29da089a (diff) | |
| download | ulab-f0c477eef466d0fbf47ecd92161c38ae474aa9ae.tar.gz ulab-f0c477eef466d0fbf47ecd92161c38ae474aa9ae.zip | |
Add magic 64 bytes to S6 svf file
Diffstat (limited to 'fpga/xilinx/programmer/bit2svf/commands.c')
| -rw-r--r-- | fpga/xilinx/programmer/bit2svf/commands.c | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/fpga/xilinx/programmer/bit2svf/commands.c b/fpga/xilinx/programmer/bit2svf/commands.c index c4a9493..bddeec4 100644 --- a/fpga/xilinx/programmer/bit2svf/commands.c +++ b/fpga/xilinx/programmer/bit2svf/commands.c @@ -2,7 +2,8 @@ Copyright (c) 2005 Juan Pablo D. Borgna <jpborgna en inti gov ar> Copyright (c) 2006-2007 Salvador E. Tropea <salvador en inti gov ar> - Copyright (c) 2005-2007 Instituto Nacional de Tecnología Industrial + Copyright (c) 2005-2007 Instituto Nacional de Tecnolog�a Industrial + Copyright (c) 2012 Timothy Pearson <kb9vqf@pearsoncomputing.net> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -276,6 +277,30 @@ do_command(char *cmd, FILE *dfp, FILE *ofp, int *col) } /* end SBITS command */ + /* SADDBITS command */ + if (strstr(cmd,"SADDBITS")) + { + /* get the args inside the () */ + args_pos_s=strchr(cmd,'('); + args_pos_e=strchr(cmd,')'); + if((!args_pos_s && args_pos_e )|| (!args_pos_e && args_pos_s)) + { + fprintf(stderr,"Bad argument specification in $SADDBITS(VAL)$\n"); + return 1; + } + if (!args_pos_s && !args_pos_e) + { + fprintf(stderr,"Bad argument specification in $SADDBITS(VAL)$\n"); + return 1; + } + memcpy(args,args_pos_s+1,(size_t)(args_pos_e-args_pos_s)); /* Copy the argument */ + args[args_pos_e-args_pos_s-1]='\0'; /* Put the null terminator */ + value=value_from(args); + *col+=fprintf(ofp,"%d",(unsigned int)(s_bits+value)); + return 0; + } + /* end SADDBITS command */ + /* SBYTES command */ if (strstr(cmd,"SBYTES")) { |
