X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=sim%2Fucsim%2Fsim.src%2Fhw.cc;h=ab0f5cfb39df2054bbf760fdc9f92af16047bb2e;hb=6ba6105dc5975c3b0cc0d1ce53f47a1ddf4be9cf;hp=210c807898670ed5a01dc79ad680354158979d50;hpb=02d4f3e2b701dcdb88981a3292d226fc818b93b7;p=fw%2Fsdcc diff --git a/sim/ucsim/sim.src/hw.cc b/sim/ucsim/sim.src/hw.cc index 210c8078..ab0f5cfb 100644 --- a/sim/ucsim/sim.src/hw.cc +++ b/sim/ucsim/sim.src/hw.cc @@ -58,15 +58,15 @@ cl_hw::~cl_hw(void) * Callback functions for changing memory locations */ -ulong -cl_hw::read(class cl_mem *mem, long addr) +t_mem +cl_hw::read(class cl_mem *mem, t_addr addr) { // Simply return the value return(mem->get(addr)); } void -cl_hw::write(class cl_mem *mem, long addr, ulong *val) +cl_hw::write(class cl_mem *mem, t_addr addr, t_mem *val) { // Do not change *val by default } @@ -89,4 +89,28 @@ cl_hw::print_info(class cl_console *con) } +t_index +cl_hws::add(void *item) +{ + int i; + t_index res; + + // pre-add + for (i= 0; i < count; i++) + { + class cl_hw *hw= (class cl_hw *)(at(i)); + hw->adding((class cl_hw *)item); + } + // add + res= cl_list::add(item); + // post-add + for (i= 0; i < count; i++) + { + class cl_hw *hw= (class cl_hw *)(at(i)); + hw->added((class cl_hw *)item); + } + return(res); +} + + /* End of hw.cc */