#include "ddconfig.h"
#include <ctype.h>
+#include "i_string.h"
// sim
#include "simcl.h"
*----------------------------------------------------------------------------
*/
-int
-cl_set_mem_cmd::do_work(class cl_sim *sim,
- class cl_cmdline *cmdline, class cl_console *con)
+//int
+//cl_set_mem_cmd::do_work(class cl_sim *sim,
+// class cl_cmdline *cmdline, class cl_console *con)
+COMMAND_DO_WORK_UC(cl_set_mem_cmd)
{
class cl_mem *mem= 0;
class cl_cmd_arg *params[4]= { cmdline->param(0),
cmdline->param(2),
cmdline->param(3) };
- if (cmdline->syntax_match(sim, MEMORY ADDRESS DATALIST)) {
+ if (cmdline->syntax_match(uc, MEMORY ADDRESS DATALIST)) {
mem= params[0]->value.memory;
t_addr start= params[1]->value.address;
t_mem *array= params[2]->value.data_list.array;
int len= params[2]->value.data_list.len;
if (len == 0)
- con->printf("Error: no data\n");
+ con->dd_printf("Error: no data\n");
else
{
int i;
}
}
else
- con->printf("%s\n", short_help?short_help:"Error: wrong syntax\n");
+ con->dd_printf("%s\n", short_help?short_help:"Error: wrong syntax\n");
return(DD_FALSE);;
}
*----------------------------------------------------------------------------
*/
-int
-cl_set_bit_cmd::do_work(class cl_sim *sim,
- class cl_cmdline *cmdline, class cl_console *con)
+//int
+//cl_set_bit_cmd::do_work(class cl_sim *sim,
+// class cl_cmdline *cmdline, class cl_console *con)
+COMMAND_DO_WORK_UC(cl_set_bit_cmd)
{
class cl_mem *mem;
t_addr mem_addr= 0;
cmdline->param(2),
cmdline->param(3) };
- if (cmdline->syntax_match(sim, BIT NUMBER)) {
+ if (cmdline->syntax_match(uc, BIT NUMBER)) {
mem= params[0]->value.bit.mem;
mem_addr= params[0]->value.bit.mem_address;
bit_mask= params[0]->value.bit.mask;
mem->dump(mem_addr, mem_addr, 1, con);
}
else
- con->printf("%s\n", short_help?short_help:"Error: wrong syntax\n");
+ con->dd_printf("%s\n", short_help?short_help:"Error: wrong syntax\n");
return(DD_FALSE);;
}
*----------------------------------------------------------------------------
*/
-int
-cl_set_port_cmd::do_work(class cl_sim *sim,
- class cl_cmdline *cmdline, class cl_console *con)
+//int
+//cl_set_port_cmd::do_work(class cl_sim *sim,
+// class cl_cmdline *cmdline, class cl_console *con)
+COMMAND_DO_WORK_UC(cl_set_port_cmd)
{
class cl_hw *hw;
long l= 0, pn= -1;
cmdline->param(2),
cmdline->param(3) };
- if (cmdline->syntax_match(sim, HW NUMBER)) {
+ if (cmdline->syntax_match(uc, HW NUMBER)) {
hw= params[0]->value.hw;
pn= hw->id;
l= params[1]->value.number;
}
- else if (cmdline->syntax_match(sim, NUMBER NUMBER)) {
+ else if (cmdline->syntax_match(uc, NUMBER NUMBER)) {
pn= params[0]->value.number;
l= params[1]->value.number;
}
else
- con->printf("%s\n", short_help?short_help:"Error: wrong syntax\n");
+ con->dd_printf("%s\n", short_help?short_help:"Error: wrong syntax\n");
if (pn < 0 ||
pn > 3)
- con->printf("Error: wrong port\n");
+ con->dd_printf("Error: wrong port\n");
else
- sim->uc->port_pins[pn]= l;
+ uc->port_pins[pn]= l;
return(DD_FALSE);;
}
*----------------------------------------------------------------------------
*/
-int
-cl_set_option_cmd::do_work(class cl_sim *sim,
- class cl_cmdline *cmdline, class cl_console *con)
+//int
+//cl_set_option_cmd::do_work(class cl_sim *sim,
+// class cl_cmdline *cmdline, class cl_console *con)
+COMMAND_DO_WORK_UC(cl_set_option_cmd)
{
char *id= 0, *s= 0;
class cl_cmd_arg *params[4]= { cmdline->param(0),
cmdline->param(2),
cmdline->param(3) };
- if (cmdline->syntax_match(sim, STRING STRING)) {
+ if (cmdline->syntax_match(uc, STRING STRING)) {
id= params[0]->value.string.string;
s= params[1]->value.string.string;
}
else
- con->printf("%s\n", short_help?short_help:"Error: wrong syntax\n");
+ con->dd_printf("%s\n", short_help?short_help:"Error: wrong syntax\n");
if (!id ||
!s)
{
- con->printf("%s\n", short_help?short_help:"Error: wrong syntax\n");
+ con->dd_printf("%s\n", short_help?short_help:"Error: wrong syntax\n");
return(DD_FALSE);
}
int i;
- for (i= 0; i < sim->uc->options->count; i++)
+ for (i= 0; i < uc->options->count; i++)
{
- class cl_option *o= (class cl_option *)(sim->uc->options->at(i));
+ class cl_option *o= (class cl_option *)(uc->options->at(i));
if (!strcmp(id, o->id))
{
o->set_value(s);