SOLVED: Nevermind, I made some mistakes in calling the wrong methods for writing/reading from ports. Thanks for your attention anyway!
I'm trying to implement this example of a memory and a cpu that are communicating.
CPU <==> MEM
The modules use a single bidirectional data-line for reading/writing.
I defined a signal in sc_main:
sc_signal<int,SC_MANY_WRITERS> s_memdata;
which I connect to the CPU and MEM module through their ports:
sc_inout<int> p_memdata;
The CPU is writing to the s_memdata signal:
p_memdata.write(getrnddata());